|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Add inner control event.On that control I have a button. That is a control (I did it by : add new class, and inherits DataGridView). On the new dataGridView there is a new property : Button b. I want to catch events of that button (from the newDataGridView). What should I do on the eventHandler ? : AddHandler FNewButton.Click, btnNew_Click .... Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Click (Handles what? Me.Click is not right, and b.click cannot be compiled). Thanks :) Am 24.04.2010 17:58, schrieb Mr. X.:
Show quoteHide quote > I have a control. "Handles" works only with fields (variable at class level) declared with> On that control I have a button. > That is a control (I did it by : add new class, and inherits DataGridView). > On the new dataGridView there is a new property : Button b. > > I want to catch events of that button (from the newDataGridView). > > What should I do on the eventHandler ? : > > AddHandler FNewButton.Click, btnNew_Click > .... > > Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Me.Click > > (Handles what? Me.Click is not right, and b.click cannot be compiled). the "Withevents" modifier. Doesn't AddHandler work? -- Armin O.K.
I add : withevents to the declaration of new object. dim withevents b as button I didn't have to add the line : AddHandler ... just add the line : Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FNewButton.Click Works fine. Thanks :)
send the class type as a parameter.
simmulate real rowEnter on DataGridView object. 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 |
|||||||||||||||||||||||