|
-
Apr 1st, 2000, 09:10 AM
#1
Thread Starter
New Member
Calling a Form Procedure from a Module ...
is it possible? 
Example: I want to call from my general module, a procedure in my Form1 from Image1_Click() ... If it's possible to do that, just tell me how please!
Another Question: From an Image array, is it possible for each of them to have a procedure like:
Image(0)_Click()
Image(1)_Click()
etc...
If so, how ?
Thanx!!

[Edited by Lady Tatjahna on 04-01-2000 at 09:13 PM]
-=-=-= Lady Tatjahna =-=-=-
-
Apr 1st, 2000, 10:07 AM
#2
Lively Member
I think that all events on a control are private and unable to be called from outside that form. If this is the case you can put a public function in your form mod:
public sub GetClick(), call that function from your module:
form1.GetClick, and have GetClick call the image1_Click().
Hope that makes sense, I started to lose myself.
As far as Image(0)_click, Image(1)_click: I tried and vb6 wouldn't let me create sep. events for each image. Just use a select case inside the Image_click(index as int)
-
Apr 1st, 2000, 10:20 AM
#3
Addicted Member
This is actually pretty easy to do. Just make sure that your routine on your form is declared as Public.
Code:
Public Sub Command1_Click()
MsgBox "Button Clicked"
End Sub
Once you do that, the rest of your program can use the Sub and call it like any other Sub or Function...
Call FormName.Command1_Click
For your next question, You will just have the one click event for the object example you gave, but you can use a Select Case statement to get the result you want ...
Code:
Select Case Index
Case 0
'Enter code for Image(0) event here.
Case 1
'Enter code for Image(1) event here.
End Select
Hope this helps.
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
|