|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
activate a click onto a picture buttonI 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. 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 Show quoteHide quote "Elton" <helpme_***@yahoo.com> schreef in bericht news:el2T4qDoGHA.4772@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. > thanks.
Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:uWOlRlEoGHA.1236@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" <helpme_***@yahoo.com> schreef in bericht > news:el2T4qDoGHA.4772@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. >> > > 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 Show quoteHide quote "Elton" <helpme_***@yahoo.com> schreef in bericht news:uTDvPvEoGHA.4248@TK2MSFTNGP05.phx.gbl... > thanks. > > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:uWOlRlEoGHA.1236@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" <helpme_***@yahoo.com> schreef in bericht >> news:el2T4qDoGHA.4772@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. >>> >> >> > > good idea.
Elton Show quoteHide quote "Michel Posseth [MCP]" <M***@posseth.com> wrote in message news:OlctiQHoGHA.4124@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" <helpme_***@yahoo.com> schreef in bericht > news:uTDvPvEoGHA.4248@TK2MSFTNGP05.phx.gbl... >> thanks. >> >> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message >> news:uWOlRlEoGHA.1236@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" <helpme_***@yahoo.com> schreef in bericht >>> news:el2T4qDoGHA.4772@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. >>>> >>> >>> >> >> > >
Get object from name
how to parse an Enum Structure in vb.net Removing the " Web Form Designer Generated Code " region after converting from ASP.NET 1.1 to ASP.NE Need help on windows service and timer Getting form to run its load event without showing form Who is using a given port? Weird problem Convert Color image to Gray Shade Image Which would be better MS ACESS or SQL Server for VB Desktop application Active Directory and VB.Net |
|||||||||||||||||||||||