Hi. I am beginner in Visual Basic. Have this situation. Have 3 TextBox in TabPage1 (TextBox1+TextBo2=TextBox3) and TextBox4 in TabPage2.

In TabPage1, the code is in TextBox2 :

If String.IsNullOrEmpty(TextBox1.Text) OrElse String.IsNullOrEmpty(TextBox2.Text) Then Exit Sub
If Not IsNumeric(TextBox1.Text) OrElse Not IsNumeric(TextBox2.Text) Then Exit Sub
TextBox3.Text = CDbl(TextBox1.Text) + CDbl(TextBox2.Text)

I want show value from TextBox3 (from TabPage1) in TextBox4 (TabPage2). Please a sugestion.

Recommended Answers

All 6 Replies

@vplay. I can't because I don't have your app in the IDE to be sure of the exact syntax. But as I did note, the if statements are gone if you use Try/Catch. Simpler code for you to work on.

commented: Thk for yours time. In c# is possible? PLEASE! +0

Per your question in the last comment. Yes. I've used try/catch or similar in the languages mentioned so far.

Untitled-111.jpg

Hi. I am beginner in Visual Basic and C#. Have this situation. 3 TextBox in TabPage1 (TextBox1+TextBo2=TextBox3) and TextBox4 in TabPage2. I want show value from TextBox3 (from TabPage1) in TextBox4 (TabPage2). Please a code in VB and/or C#.

Tell me what happens with simply:

TextBox3.Text = TextBox1.Text

PS. Remember that beyond my comment about Try+Catch you may have other issues to think about such as:

  1. Textbox and numbers. To put a number in a textbox you have to turn it back into a string. Example: TextBox.Text = somevariable.ToString
  2. Access of objects on other forms or in your case Tabs. To address this I asked you to perform a simple test with TextBox3.Text = TextBox1.Text so I can address that on its own.
commented: Value from textBox3 = textBox4. textBox3 it is in tabPage1, textBox4 it is in tabPage2. TK +0
commented: Is this the Robert Proffitt who use to be a submarine captain? +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.