Handle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am converting a project from VB6 to VB.Net. In vb6, I created a textbox array on the form, and depending on the table querying, I would load new textbox's based on the fields in the table. I would store the index in a user defined type fldInfo array that also stored the field name. Then, when the user double clicked a textbox, depending on the field name stored in type fldInfo, I would perform some function such as opening a dialog box

In vb.net, how would I perform this same function without the indexes? I know that you set the Handles on a function to handle a double click. Is it possible to add handles at runtime?
 
Addhandler.


Doug said:
I am converting a project from VB6 to VB.Net. In vb6, I created a textbox
array on the form, and depending on the table querying, I would load new
textbox's based on the fields in the table. I would store the index in a
user defined type fldInfo array that also stored the field name. Then, when
the user double clicked a textbox, depending on the field name stored in
type fldInfo, I would perform some function such as opening a dialog box.
In vb.net, how would I perform this same function without the indexes? I
know that you set the Handles on a function to handle a double click. Is it
possible to add handles at runtime?
 
Doug said:
I am converting a project from VB6 to VB.Net. In vb6, I created a
textbox array on the form, and depending on the table querying, I
would load new textbox's based on the fields in the table. I would
store the index in a user defined type fldInfo array that also stored
the field name. Then, when the user double clicked a textbox,
depending on the field name stored in type fldInfo, I would perform
some function such as opening a dialog box.

In vb.net, how would I perform this same function without the
indexes? I know that you set the Handles on a function to handle a
double click. Is it possible to add handles at runtime?

Yes, use the Addhandler statement.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
* "=?Utf-8?B?RG91Zw==?= said:
I am converting a project from VB6 to VB.Net. In vb6, I created a
textbox array on the form, and depending on the table querying, I would
load new textbox's based on the fields in the table. I would store the
index in a user defined type fldInfo array that also stored the field
name. Then, when the user double clicked a textbox, depending on the
field name stored in type fldInfo, I would perform some function such as
opening a dialog box.

In vb.net, how would I perform this same function without the indexes?
I know that you set the Handles on a function to handle a double click.
Is it possible to add handles at runtime?

Add the handler using 'AddHandler' and have a look at the handler's
'sender' parameter to get a reference to the control that raised the
event.
 
Thanks! Works great

----- CJ Taylor wrote: ----

Addhandler


Doug said:
I am converting a project from VB6 to VB.Net. In vb6, I created a textbo
array on the form, and depending on the table querying, I would load ne
textbox's based on the fields in the table. I would store the index in
user defined type fldInfo array that also stored the field name. Then, whe
the user double clicked a textbox, depending on the field name stored i
type fldInfo, I would perform some function such as opening a dialog boxknow that you set the Handles on a function to handle a double click. Is i
possible to add handles at runtime
 
Just don't forget to set the name property accordingly... It caused me 3
hours of nightmares :)

JLW

Doug said:
I am converting a project from VB6 to VB.Net. In vb6, I created a textbox
array on the form, and depending on the table querying, I would load new
textbox's based on the fields in the table. I would store the index in a
user defined type fldInfo array that also stored the field name. Then, when
the user double clicked a textbox, depending on the field name stored in
type fldInfo, I would perform some function such as opening a dialog box.
In vb.net, how would I perform this same function without the indexes? I
know that you set the Handles on a function to handle a double click. Is it
possible to add handles at runtime?
 
Back
Top