|
-
Jan 10th, 2003, 11:02 AM
#1
Thread Starter
Lively Member
Calling functions
Form1 has a function called UpdateDisplay() how can I call it from Form2 ?
Thanks for any advice.
-
Jan 10th, 2003, 11:26 AM
#2
The one way that I know of:
Form1 needs to be a form derived from Form2 meaning Form1 needs to be in code in Form2 something like
Dim F1 as new Form1
Then, make the function public. After which, F1.FunctionName should work fine.
Aside from that, I imagine it would be possible using AddressOf, but I'm not sure how.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Jan 10th, 2003, 11:31 AM
#3
When form1 calls form2 have it pass itself as the Owner then form2 can use that property to access it.
VB Code:
'in form1
dim frm as New Form2()
frm.Owner=Me
frm.Show()
'in form2
'you have to cast to the specific form to access custom items on it
DirectCast(Me.Owner,Form1).UpdateDisplay()
-
Jan 10th, 2003, 12:38 PM
#4
Frenzied Member
Why don't you just put the UpdateDisplay() function in a code module? Then you can call it from both forms.
~Peter

-
Jan 10th, 2003, 01:23 PM
#5
Thread Starter
Lively Member
Edneeis,
YOU solved my problem !!! Thank you so very very very much !
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
|