|
-
Sep 23rd, 2002, 05:44 AM
#1
Thread Starter
New Member
-
Sep 23rd, 2002, 06:07 AM
#2
yay gay
VB Code:
dim mform1 as new form1
dim mform2 as new form2
mform1.text="lol"
mform2.text=mform1.text
learn to use msdn or search in the foruns cuz ppl start getting sick of answerind always the same *EASY* questions that can be found everywhere...
btw...this is the way OOP works..if u dont know plz buy a book cuz its all very diferent and is better u learn the theory cuz using old-style vb6 sucks in vb.net
-
Sep 23rd, 2002, 08:45 AM
#3
Thread Starter
New Member
Thihihi!
It doesn't work. I still don't know how to set the Form1.Text from within the code of Form2.
Have you tried it your self? Can you send me a sample that does this *EASY* operation?
-
Sep 23rd, 2002, 11:41 AM
#4
Hyperactive Member
Re: Thihihi!
Originally posted by Albino
It doesn't work. I still don't know how to set the Form1.Text from within the code of Form2.
Have you tried it your self? Can you send me a sample that does this *EASY* operation?
You may know VB6, but VB.NET is a completely different language!
Go buy a book on it!
Oh, and PT's code should work, how did you write it?
-
Dec 1st, 2003, 03:40 AM
#5
Frenzied Member
Originally posted by PT Exorcist
VB Code:
dim mform1 as new form1
dim mform2 as new form2
mform1.text="lol"
mform2.text=mform1.text
learn to use msdn or search in the foruns cuz ppl start getting sick of answerind always the same *EASY* questions that can be found everywhere...
btw...this is the way OOP works..if u dont know plz buy a book cuz its all very diferent and is better u learn the theory cuz using old-style vb6 sucks in vb.net
did you ever stop to think this member DID search? I searched for the same problem but his is the only one I found.
-
Dec 1st, 2003, 08:15 AM
#6
yay gay
did you ever stop to think this member DID search?
Are you him with a different nickname? If yes, if searched did a bad search, if not i think you should be quiet as you dont know if he actually did it or not.
Also it's not you who at that time(a year ago) had to answer everyday to the same basic posts that sometimes in the main vb.net forum page could be found several times and people just keeped asking instead of going to look at some posts bellow.
\m/  \m/
-
Dec 1st, 2003, 10:29 AM
#7
Frenzied Member
Originally posted by PT Exorcist
VB Code:
dim mform1 as new form1
dim mform2 as new form2
mform1.text="lol"
mform2.text=mform1.text
learn to use msdn or search in the foruns cuz ppl start getting sick of answerind always the same *EASY* questions that can be found everywhere...
btw...this is the way OOP works..if u dont know plz buy a book cuz its all very diferent and is better u learn the theory cuz using old-style vb6 sucks in vb.net
This is not gonna work because those text boxes are declared private. There are 2 solutions.
1. The form you wanna get the text from, you can change the textbox from private to public. I would'nt suggest this since this is not following OOP rules.
2. On the form you want to get the text from, create a property that exposes the text box.
VB Code:
Public Property MyText() as String
Get
Return TextBox1.Text
End Get
End Property
-
Dec 1st, 2003, 11:30 AM
#8
Thread Starter
New Member
Think I've solved the problem by now:
In Form1 I've written this:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2(Me)
frm.Show()
End Sub
and I've declared a private variable of the type Form1 like this:
VB Code:
Private prevForm As Form1
Then I changed a bit on Form2's new-procedure:
VB Code:
Public Sub New(ByVal parentForm As Form1)
MyBase.New()
Me.prevForm = parentForm
InitializeComponent()
End Sub
And then at last I've changed Form2' Button1 to this:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
prevForm.Text = "Haba haba!"
End Sub
This works.... I think...
-
Dec 5th, 2003, 09:14 PM
#9
Frenzied Member
Originally posted by PT Exorcist
Are you him with a different nickname? If yes, if searched did a bad search, if not i think you should be quiet as you dont know if he actually did it or not.
Also it's not you who at that time(a year ago) had to answer everyday to the same basic posts that sometimes in the main vb.net forum page could be found several times and people just keeped asking instead of going to look at some posts bellow.
no, I'm not the gentleman under a disguise. I'm too old to play games like that.
No, I don't know whether or not he searched. You and I are alike in at least one way...we both are tired of unnecessary posts.
-
Dec 5th, 2003, 09:47 PM
#10
Thread Starter
New Member
I did search for help first, but didn't find anything. So this was my last option, but since you couldn't give me a correct answer I had to find the soultion my self. You know... This is a forum, and if you get angry because someone asks a question, you got yourself a serious problem! Doesn't matter if someone has answered the easy question befor! Give the questioner a link to where the answer can be found instead of writing a lot about all the *stupid* people that have to use the forum! The forum is here because you can help people that aren't that good in vb.
-
Dec 5th, 2003, 10:41 PM
#11
Addicted Member
I agree with Albino, if your not here to help, then why are you here?
I you don't like or agree with a post, don't answer it, just ignore it.
But I must add that there are many helpful people here in the forums, that would help you out in anyway possible.
-
Dec 5th, 2003, 11:34 PM
#12
Originally posted by Hole-In-One
I you don't like or agree with a post, don't answer it, just ignore it.
I agree with this statement and ask that everyone "play nicely". Let's keep any additional post in this thread focused on communicating or passing information between forms. The other comments can be placed in feedback or done in PMs.
Thanks,
Brad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|