|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
simmulate real rowEnter on DataGridView object.Hello.
I want to do by force : RowEnter event of DataGridViewObject. I made a function on my code : Public Sub ReEnter() Invoke(New EventHandler(AddressOf dg_RowEnter)) End Sub Where dg_RowEnter is the event : Private Sub dg_RowEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Me.RowEnter Why I don't reach the sub : dg_RowEnter, as I have described in the code above? Thanks :) Am 24.04.2010 10:04, schrieb Mr. X.:
Show quoteHide quote > Hello. Why do you use Invoke? It's used for cross-thread calls.> I want to do by force : RowEnter event of DataGridViewObject. > > I made a function on my code : > Public Sub ReEnter() > Invoke(New EventHandler(AddressOf dg_RowEnter)) > End Sub > > Where dg_RowEnter is the event : > Private Sub dg_RowEnter(ByVal sender As System.Object, ByVal e As > System.Windows.Forms.DataGridViewCellEventArgs) Handles Me.RowEnter > > > Why I don't reach the sub : dg_RowEnter, as I have described in the code > above? And why call an event handler? Which event occured? If you want to set the currenct cell, you have to set a property or call a method of the control. -- Armin I want to force RowEnter event (Which exists on DataGridView).
Like forcing clicking on button. On some languages I assume it is called fireEvent). I don't want to set the current cell, just do RowEnter, for instance. Thanks :) Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:OULt2254KHA.980@TK2MSFTNGP04.phx.gbl... > Am 24.04.2010 10:04, schrieb Mr. X.: >> Hello. >> I want to do by force : RowEnter event of DataGridViewObject. >> >> I made a function on my code : >> Public Sub ReEnter() >> Invoke(New EventHandler(AddressOf dg_RowEnter)) >> End Sub >> >> Where dg_RowEnter is the event : >> Private Sub dg_RowEnter(ByVal sender As System.Object, ByVal e As >> System.Windows.Forms.DataGridViewCellEventArgs) Handles Me.RowEnter >> >> >> Why I don't reach the sub : dg_RowEnter, as I have described in the code >> above? > > Why do you use Invoke? It's used for cross-thread calls. > And why call an event handler? Which event occured? > > If you want to set the currenct cell, you have to set a property or > call a method of the control. > > -- > Armin Am 24.04.2010 14:02, schrieb Mr. X.:
> I want to force RowEnter event (Which exists on DataGridView). Whenever the sun shines, your solar cells work and the generated> Like forcing clicking on button. > On some languages I assume it is called fireEvent). > I don't want to set the current cell, just do RowEnter, for instance. power switches a lever. If it's dark, you have to switch the lever manually instead of trying to make the sun shine. -- Armin ROFL,
With what Armin shows that he has already answered your question in the previous message. Calling the Row change method MyRowChangeMethod(nothing,nothing) If you use the sender and the eventsarguments in your invoked method, then you have first to set that sender and eventsargs MyRowChangeMethod(myCreatedSender,MyCreatedEeventsArgument) Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:eEDDdb74KHA.5848@TK2MSFTNGP06.phx.gbl... > Am 24.04.2010 14:02, schrieb Mr. X.: >> I want to force RowEnter event (Which exists on DataGridView). >> Like forcing clicking on button. >> On some languages I assume it is called fireEvent). >> I don't want to set the current cell, just do RowEnter, for instance. > > Whenever the sun shines, your solar cells work and the generated > power switches a lever. If it's dark, you have to switch the lever > manually instead of trying to make the sun shine. > > > -- > Armin > Armin,
In fact, very much my style, I had not expected this from you. But a very good analogy. Cor .. Show quoteHide quote > > Whenever the sun shines, your solar cells work and the generated > power switches a lever. If it's dark, you have to switch the lever > manually instead of trying to make the sun shine. Am 25.04.2010 11:20, schrieb Cor Ligthert[MVP]:
Show quoteHide quote > Armin, whereas I'm pressing the lever myself. So we don't agree.> > In fact, very much my style, I had not expected this from you. > > But a very good analogy. > > Cor > > .. >> >> Whenever the sun shines, your solar cells work and the generated >> power switches a lever. If it's dark, you have to switch the lever >> manually instead of trying to make the sun shine. > :-) Well, but you're putting a torch on the solar cells to "produce" energy, In other words: Never call an event handler manually. No event occured. Instead, start the same thing in the event handler and also in the code where you want to start it. And in code words: (also for Mr. Eggs) sub MyRowChangeMethod(sender, args) DoIt 'Here's where you want to do it End Sub sub YetAnotherMethod yadayada DoIt 'and here you wanna do it also yadayada end sub sub DoIt debug.print "about to do it..." sleep a long time debug.print "dunnit!" end sub -- Armin
Update command to update field
signing certificate error... Sending messages between windows Setting Event Log Size setting Posting a form to webserver using vb.net ASP table background color FTP Server Passive Mode Running an ActiveX EXE from VB2008 app Run Unix shell script from VB.NET Is that a blank in your TextBox ... |
|||||||||||||||||||||||