Click here to Skip to main content
15,917,565 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am new in c#, please someone help me to get the answer.....
I am having textbox1 and lebel5...
if i will insert some numbers in textbox1 and press tab key.The inserted numbers in textbox1 will convert and fil into label5.
Below I am sending code snippet...


/////////////////////////////////////////////
if (sMode == "view")
                {
                    // process for showing user detail to administrator

                    // write code to get user detail


                    DataTable dtViewData = null;
                    string sStatusTmp = lib.getCurrentStatus(sCompany,sLocation, sEmpCode.Trim());

                    dtViewData = lib.ViewData(sCompany, sLocation,sEmpCode);
                    if (dtViewData != null)
                    {
                        label1.Text = dtViewData.Rows[0].ItemArray[2].ToString();
                        Label2.Text = dtViewData.Rows[0].ItemArray[7].ToString();
                        TextBox1.Text = dtViewData.Rows[0].ItemArray[3].ToString();
                        label5.Text = dtViewData.Rows[0].ItemArray[4].ToString();
                        label3.Text = dtViewData.Rows[0].ItemArray[5].ToString();
                        label4.Text = dtViewData.Rows[0].ItemArray[6].ToString();
                        btnSubmit.Enabled = false;
                        TextBox1.Enabled = false;
                        label5.Enabled = false;


                    }
                }
                else
                {
                    string sStatusTmp = lib.getCurrentStatus(sCompany, sLocation, sEmpCode.Trim());
                    label1.Text = sEmpCode;
                    Label2.Text = DateTime.Now.ToShortDateString();

                    // show blank below feild to user - user will fill the feild.

                    TextBox1.Text = sexpense;
                    label5.Text = sexpensetxt;
                    DataTable dtdate = lib.getdateDetail("MCL", "RNV", sEmpCode);

                    label3.Text = dtdate.Rows[0].ItemArray[0].ToString();
                    label4.Text = dtdate.Rows[0].ItemArray[1].ToString();


                }
            }


Thanks a lot...
Posted
Updated 19-Jun-10 5:35am
v3
Comments
Smithers-Jones 19-Jun-10 10:30am    
Reason for my vote of 1
I told you to improve your previous "question", not to post a new one with basically the same thing again.
Abhinav S 19-Jun-10 11:58am    
Searching on the Internet should give you some examples on how to do this....

1 solution

Here[^]
 
Share this answer
 

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