calling event form module

Thread Solved

Join Date: Jul 2008
Posts: 27
Reputation: deftones is an unknown quantity at this point 
Solved Threads: 0
deftones deftones is offline Offline
Light Poster

calling event form module

 
0
  #1
20 Days Ago
Hey, one simple question: how to call Image1_click event form module?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #2
20 Days Ago
not like that. what will happen in click event that write in module. plz check it.
Attached Files
File Type: zip module.zip (1.7 KB, 2 views)
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 372
Reputation: Jupiter 2 is an unknown quantity at this point 
Solved Threads: 26
Jupiter 2 Jupiter 2 is offline Offline
Posting Whiz

Click Event Image

 
0
  #3
20 Days Ago
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Call sohel(Image1)
  3. End Sub

Module 1
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Function sohel(a As Image)
  2. a.Visible = False
  3. End Function
What do you actually want to happen when you click the command button? Will the image "load" from somewhere? Or change?

You cannot use a function to change yje visible factor of an image.

If you want to click the button then
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. if image1.visible=false then
  3. image1.visible=true
  4. elseif image1.visible=true then
  5. image1.visible=false
  6. end if
  7. end sub
Last edited by Jupiter 2; 20 Days Ago at 10:37 am. Reason: if end if tags
If ALL my answers are wrong, only then will I read the question
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 810
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark
 
0
  #4
20 Days Ago
Jupiter2,

Here is a way to shorten you comman1_click code...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Image1.Visible = Not Image1.Visible


Just a piece of knowledge I thought I would pass along.

As for the OP, deftones, Jupiter2 has most of what you need to accomplish what you want but allow me to clarify more...

As of right now I cannot see a way to directly call an images click event but you can create a public sub proceedure in your form and call it...

in module...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Call Form1.MySub

In Form...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Public Sub MySub()
  2. Call Image1_Click
  3. End Sub

However, if you were to call a command button then you could call it directly by...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Form1.Command1.Value = True



Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 27
Reputation: deftones is an unknown quantity at this point 
Solved Threads: 0
deftones deftones is offline Offline
Light Poster
 
0
  #5
20 Days Ago
Oh, now it's clear what I did wrong - I forgot to declare "public", therefore wasn't able to call that sub from module. Thanks guys.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC