Click here to Skip to main content
15,905,971 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to create a condition under txtOrderStatus.Text located at(frmSalesOrder.cs) to indicate "Paid" if txtTotal.Text from frmPayment.cs is equal to txtSalesOrderTotal.Text located at frmSalesOrder.cs


frmSalesOrder.cs
txtOrderStatus.Text ---> indicate "Paid"
txtSalesOrderTotal.Text


frmPayment.cs
txtTotal.Text
Posted
Updated 9-May-11 20:54pm
v2
Comments
Pong D. Panda 10-May-11 2:56am    
Web or Winforms?
wolfsor 10-May-11 3:02am    
windows form
Pong D. Panda 10-May-11 4:05am    
check mo solution ko pre. san ka sa pinas?

frmSalesOrder
---------------
Make your frmSalesOrder class public.

Create a property that will hold your Total value;
public string Total { get; set; }


Then on your button click event that will transfer to frmSalesOrder, set that property.
Total = txtTotal.Text;


frmSalesOrder
---------------

Then you can now access the Total from here.

txtOrderStatus.Text = frmSalesOrder.Total == txtSalesOrderTotal.Text ? "Paid" : "Not Paid";
 
Share this answer
 
Comments
Sandeep Mewara 10-May-11 5:40am    
My 5!
If it is web application


as ur textboxes are on differnt page , u can store both values in session and can compare like.

session["Total"]=txtTotal.text;
session["sales"]=txtsalesorder.text;

on the page u want to compare u can do like

if(session["Total"].tostring()==session["sales"].tostring())
txtorderstatus.text=paid;

If it is windows 


ucan store textboxvalue in string like

string Total=txtTotal.text;


on other page u can retreive like

Form1.Total
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900