|
-
Aug 29th, 2002, 09:43 AM
#1
Thread Starter
New Member
passing data form form1 to form2 (or vice versa)
how can you change a value in another form from another form?
in vb6 you could just do this:
form1.label.caption = "blah"
what ive done is this:
dim frm as new form1
form1.label.caption = "halb"
but this will only work if i hide form1, then show it again after im done with form2.
any help is appreciated
"Well of course, everything looks bad if you remember it." - Homer Simpson 
-
Aug 29th, 2002, 10:43 AM
#2
Frenzied Member
make a property on form one
VB Code:
Public Property LabelCaption() As String
Get
LabelCaption=Label.Text
End Get
Set(ByVal Value As String)
Label.Text = LabelCaption
End Set
End Property
that should work. then Form1.LabelCaption = "New Data"
and if you make a new form1 you are working with a new form1
not the one you where looking at
try activeForm
Magiaus
If I helped give me some points.
-
Aug 29th, 2002, 04:14 PM
#3
Thread Starter
New Member
well i made the public property on form1, but how do i use it on form2????
just typing form1.label = "whatever" wont work, i would have to dim frm as new form1 then do frm.label = "whatever" but then its the same problem as before.
what do you mean by try activeform?
"Well of course, everything looks bad if you remember it." - Homer Simpson 
-
Aug 30th, 2002, 10:23 AM
#4
Frenzied Member
you don't need the property i posted that before i realized what i was saying. look here for some help http://www.vbforums.com/showthread.p...42#post1151542
and maybe cander can explain it to you i am at a loss to provide a good explination.
Magiaus
If I helped give me some points.
-
Aug 30th, 2002, 10:24 AM
#5
Frenzied Member
oh and if you made the property shared it would work but on all form1's
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 02:37 PM
#6
Frenzied Member
ok go look at the other thread
Magiaus
If I helped give me some points.
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
|