473,395 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

activate a click onto a picture button

Dear All,

I am new to vb , please help.

I have a picture , and a picture_click( ) function. What I want to do is to
have a simulate a click event onto the picture in a loop. However, when I
write:
for i = 1 to 10
picture_click()
....
it gives me an error messge, said that I missed some parameter in the click
function call.
I searched through google, and found some people suggest to put "sender" and
"e" in the () as parameter.

but then another error message generated, sender and e is not definted.

Can you help? thanks.
Jul 5 '06 #1
4 1877
Elton,

You are not the first who asked this, but why not call just the event that
you want to do with the click than to perform the click.

MyEvent(nothing,nothing) is mostly the most easiest, you can for the rest
make it as nice as you want.

(For this we get a reply from Herfried as usual).

Cor

"Elton" <he********@yahoo.comschreef in bericht
news:el**************@TK2MSFTNGP03.phx.gbl...
Dear All,

I am new to vb , please help.

I have a picture , and a picture_click( ) function. What I want to do is
to have a simulate a click event onto the picture in a loop. However, when
I write:
for i = 1 to 10
picture_click()
....
it gives me an error messge, said that I missed some parameter in the
click function call.
I searched through google, and found some people suggest to put "sender"
and "e" in the () as parameter.

but then another error message generated, sender and e is not definted.

Can you help? thanks.

Jul 5 '06 #2
thanks.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uW**************@TK2MSFTNGP03.phx.gbl...
Elton,

You are not the first who asked this, but why not call just the event that
you want to do with the click than to perform the click.

MyEvent(nothing,nothing) is mostly the most easiest, you can for the rest
make it as nice as you want.

(For this we get a reply from Herfried as usual).

Cor

"Elton" <he********@yahoo.comschreef in bericht
news:el**************@TK2MSFTNGP03.phx.gbl...
>Dear All,

I am new to vb , please help.

I have a picture , and a picture_click( ) function. What I want to do is
to have a simulate a click event onto the picture in a loop. However,
when I write:
for i = 1 to 10
picture_click()
....
it gives me an error messge, said that I missed some parameter in the
click function call.
I searched through google, and found some people suggest to put "sender"
and "e" in the () as parameter.

but then another error message generated, sender and e is not definted.

Can you help? thanks.


Jul 5 '06 #3

i do something else
in all the projects i write i only use the events as callers to my methods
this makes life a lot easier :-)

example ?
so instead of this

Private Sub btnSavePicture_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnSavePicture.Click
' Compose the picture's base file name.
Dim file_name As String = Application.ExecutablePath
file_name = file_name.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\test."

' Get a Bitmap.
Dim bm As Bitmap = picImage.Image

' Save the picture as a bitmap, JPEG, and GIF.
bm.Save(file_name & "bmp", _
System.Drawing.Imaging.ImageFormat.Bmp)
bm.Save(file_name & "jpg", _
System.Drawing.Imaging.ImageFormat.Jpeg)
bm.Save(file_name & "gif", _
System.Drawing.Imaging.ImageFormat.Gif)

End Sub


i do this
Private Sub btnSavePicture_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnSavePicture.Click

SavePicture()
End Sub

private sub SavePicture ()
' Compose the picture's base file name.
Dim file_name As String = Application.ExecutablePath
file_name = file_name.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\test."

' Get a Bitmap.
Dim bm As Bitmap = picImage.Image

' Save the picture as a bitmap, JPEG, and GIF.
bm.Save(file_name & "bmp", _
System.Drawing.Imaging.ImageFormat.Bmp)
bm.Save(file_name & "jpg", _
System.Drawing.Imaging.ImageFormat.Jpeg)
bm.Save(file_name & "gif", _
System.Drawing.Imaging.ImageFormat.Gif)
end sub

"Elton" <he********@yahoo.comschreef in bericht
news:uT**************@TK2MSFTNGP05.phx.gbl...
thanks.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uW**************@TK2MSFTNGP03.phx.gbl...
>Elton,

You are not the first who asked this, but why not call just the event
that you want to do with the click than to perform the click.

MyEvent(nothing,nothing) is mostly the most easiest, you can for the rest
make it as nice as you want.

(For this we get a reply from Herfried as usual).

Cor

"Elton" <he********@yahoo.comschreef in bericht
news:el**************@TK2MSFTNGP03.phx.gbl...
>>Dear All,

I am new to vb , please help.

I have a picture , and a picture_click( ) function. What I want to do is
to have a simulate a click event onto the picture in a loop. However,
when I write:
for i = 1 to 10
picture_click()
....
it gives me an error messge, said that I missed some parameter in the
click function call.
I searched through google, and found some people suggest to put "sender"
and "e" in the () as parameter.

but then another error message generated, sender and e is not definted.

Can you help? thanks.



Jul 5 '06 #4
good idea.

Elton

"Michel Posseth [MCP]" <MS**@posseth.comwrote in message
news:Ol**************@TK2MSFTNGP03.phx.gbl...
>
i do something else
in all the projects i write i only use the events as callers to my methods
this makes life a lot easier :-)

example ?
so instead of this

Private Sub btnSavePicture_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnSavePicture.Click
' Compose the picture's base file name.
Dim file_name As String = Application.ExecutablePath
file_name = file_name.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\test."

' Get a Bitmap.
Dim bm As Bitmap = picImage.Image

' Save the picture as a bitmap, JPEG, and GIF.
bm.Save(file_name & "bmp", _
System.Drawing.Imaging.ImageFormat.Bmp)
bm.Save(file_name & "jpg", _
System.Drawing.Imaging.ImageFormat.Jpeg)
bm.Save(file_name & "gif", _
System.Drawing.Imaging.ImageFormat.Gif)

End Sub


i do this
Private Sub btnSavePicture_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles _
btnSavePicture.Click

SavePicture()
End Sub

private sub SavePicture ()
' Compose the picture's base file name.
Dim file_name As String = Application.ExecutablePath
file_name = file_name.Substring(0, _
file_name.LastIndexOf("\bin")) & _
"\test."

' Get a Bitmap.
Dim bm As Bitmap = picImage.Image

' Save the picture as a bitmap, JPEG, and GIF.
bm.Save(file_name & "bmp", _
System.Drawing.Imaging.ImageFormat.Bmp)
bm.Save(file_name & "jpg", _
System.Drawing.Imaging.ImageFormat.Jpeg)
bm.Save(file_name & "gif", _
System.Drawing.Imaging.ImageFormat.Gif)
end sub

"Elton" <he********@yahoo.comschreef in bericht
news:uT**************@TK2MSFTNGP05.phx.gbl...
>thanks.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uW**************@TK2MSFTNGP03.phx.gbl...
>>Elton,

You are not the first who asked this, but why not call just the event
that you want to do with the click than to perform the click.

MyEvent(nothing,nothing) is mostly the most easiest, you can for the
rest make it as nice as you want.

(For this we get a reply from Herfried as usual).

Cor

"Elton" <he********@yahoo.comschreef in bericht
news:el**************@TK2MSFTNGP03.phx.gbl...
Dear All,

I am new to vb , please help.

I have a picture , and a picture_click( ) function. What I want to do
is to have a simulate a click event onto the picture in a loop.
However, when I write:
for i = 1 to 10
picture_click()
....
it gives me an error messge, said that I missed some parameter in the
click function call.
I searched through google, and found some people suggest to put
"sender" and "e" in the () as parameter.

but then another error message generated, sender and e is not definted.

Can you help? thanks.



Jul 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
1
by: kimmie | last post by:
I am using buttons on a toolbar and I want to use the buttons as toggles. When I click the button the first time I want my picture box to display by setting the picture box to visible. But I need...
2
by: Kishan Hathiwala | last post by:
Hi just study the following code... i have kept a command button and on its click event i have written the following code: (assume that there are two forms- form1 and form2 and command button...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
2
by: kaosyeti | last post by:
my primary form, formlauncher goes visible=false when i click any of 6 buttons on it that open other forms. one of those forms (only one) has docmd. maximize in it's open event. when any of these...
0
by: Jim in Arizona | last post by:
I've got a datalist with an ItemTemplate and EditItemTemplate. Its strange (to me), but when I have some records showing (data list items, if you will), and I click the Edit button on the first...
1
by: pearturtle123 | last post by:
Hi, I am new to Python and I am using PAMIE to manipulate IE browser. Currently, I have IE window 1 launched, after I clicked on a link on window 1, a second IE window 2 isopened. Then, I want...
0
by: nraji | last post by:
hi, I have designed a web part using VS 2003 (Web control library template). I need to publish that in share point. Its not like drag and drop the things from toolbar. Every thing I need to do in...
0
by: james8901 | last post by:
Hi folks, I need your help. I'm new to flash so please bear this in mind. My problem is this: I have a picture of a phone on the stage which I have made into a button. What I want is that,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.