Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer Data From Form2 back to Form1 1

Status
Not open for further replies.

NEWC0DER

IS-IT--Management
Joined
Jun 6, 2006
Messages
1
Location
CA
I am using VB 2003.net

I have a field that I want to have the ability fill in a great about of data, but not take up the whole screen.

On the form I have a small text box "Quote_Note" that Shows 5-6 lines of my typed test. For ease of typing and to see a whole screen when typing. I am opening a new form "Text_Box" that is one large text box called Quote_Note.

Private Sub QUOTE_NOTE_ENTER(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QUOTE_NOTE.Enter
Dim TEXT_BOX As New TEXT_BOX
TEXT_BOX.QUOTE_NOTE.Text = QUOTE_NOTE.Text
TEXT_BOX.Show()
End Sub


Issue 1)How do I get the data back to my calling form to fill the the click on text box Quote.Quote_note.text from the data entered into TEXT_BOX.Quote_note.text

2) When I tab into Quote.Quote_note.text and it opens TEXT_BOX.Quote_note.text I get a cursor
but if I mouse click on Quote.Quote_note.text I do not? Any Ideas.
 
I see it you joined today here,.. so welcome!

I could possibly help but the naming style confuses me. In vb6 for example "we" used to use a prefix 'frm' + something, to name a form. For textbox the 'txt'. In .NET "we" are supposed to use the whole name, like: TextBox1TextBox or QuotesForm.
One other thing to mention, as you are new to vb.net (i suppose).. It is not good to have direct access to the controls or variables of an other class (TEXT_BOX.QUOTE_NOTE.Text = QUOTE_NOTE.Text). You should create a property. Perhaps it may be good if you overloaded the constructor...(to pass the text) as the form does too little things.

As for the 1), you do TEXT_BOX.Show(). What if the user goes back and enters again in the textbox? An other form will show up. Have you considered changing to TEXT_BOX.ShowDialog() ?

 
Another option is to create a delegate back to the original form and pass the "new" text as a variable.

If you google "Delegate Visual Basic" you'll find a ton of examples.
 
"we" are supposed to use the whole name

No I'm not. You can still use hungarian notation.

A delegate would be very professional but a bit overkill if you don't have threads (I think.)

And the other problems will all be solved if you look in the faqs for something with "a thousand ways to..." written by ThatRickGuy. And getting to grips with OO would be nice.

Christiaan Baes
Belgium

"My new site" - Me
 
No I'm not. You can still use hungarian notation.

Anyone can use whatever he wants. There is no difference even if you name a textbox1 as 'TreeView1'. A notation (hung/whole) is helpful to other programmers... unless the developer is and will be only one for the project.

I use the old notation too. Half of my projects in .NET use the hung-naming style.
 
Unlike JAVA where they seem to have very strict conventions wich are followed by the community because it's what SUN recommends.

VB.NET has several conventions because Microsoft don't really seem to care. And it's microsoft that came up with a few of them.

But like you say, who cares what you use as long as we can understand what the other programmer is saying.

And why did I get a star?

Christiaan Baes
Belgium

"My new site" - Me
 
The star is a little weird. !
Did you thank yourself ? LOL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top