Extracting controls from a vb form in vb.net
-
how should i extract the controls from vb form through code??????????????:^) Mian Rashed Inam Khattak
-
how should i extract the controls from vb form through code??????????????:^) Mian Rashed Inam Khattak
-
what is for you "extracting a control from a form" please ?
TOXCCT >>> GEII power
[toxcct][VisualCalc]i have placed textboxes and some buttons on a form in a group box. now i want to control thse text boxes in a module. what should i do? Mian Rashed Inam Khattak
-
i have placed textboxes and some buttons on a form in a group box. now i want to control thse text boxes in a module. what should i do? Mian Rashed Inam Khattak
if you made yourform correctly, the controls on it are declare at least protected, better private. you cannot so access them from outside the form... i don't really understand why you want to do such a thing ? can you light my thought please ?
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
if you made yourform correctly, the controls on it are declare at least protected, better private. you cannot so access them from outside the form... i don't really understand why you want to do such a thing ? can you light my thought please ?
TOXCCT >>> GEII power
[toxcct][VisualCalc]oh sure. actually i have placed textboxes on a form which are disabled by default. now i want to pass this form to a module which contains a function that is going to check that "which control is textbox" and then will enable these text boxes. now the problem is that when i pass the form to module, i cannot make it to ditinguish b/w textboxes and other controls. if not enough plz do guide me.... Mian Rashed Inam Khattak
-
oh sure. actually i have placed textboxes on a form which are disabled by default. now i want to pass this form to a module which contains a function that is going to check that "which control is textbox" and then will enable these text boxes. now the problem is that when i pass the form to module, i cannot make it to ditinguish b/w textboxes and other controls. if not enough plz do guide me.... Mian Rashed Inam Khattak
mian rashed wrote: a function that is going to check that "which control is textbox" why, are your controls created dynamically ? don't the textbox always have the same ids ? the form should be modified from within it, so, i suggest you to make a public function on your form, that is subject to be called by your module (so, you'll have the effect that the moddule actually updates the controls' statuses...
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
mian rashed wrote: a function that is going to check that "which control is textbox" why, are your controls created dynamically ? don't the textbox always have the same ids ? the form should be modified from within it, so, i suggest you to make a public function on your form, that is subject to be called by your module (so, you'll have the effect that the moddule actually updates the controls' statuses...
TOXCCT >>> GEII power
[toxcct][VisualCalc]ok now thats a good solution. the form stores all the controls in an array what is the name of that array? Mian Rashed Inam Khattak
-
mian rashed wrote: a function that is going to check that "which control is textbox" why, are your controls created dynamically ? don't the textbox always have the same ids ? the form should be modified from within it, so, i suggest you to make a public function on your form, that is subject to be called by your module (so, you'll have the effect that the moddule actually updates the controls' statuses...
TOXCCT >>> GEII power
[toxcct][VisualCalc]thats nice one mate, but could you tell what array does the form uses for the purpose of storing controls. thanks Mian Rashed Inam Khattak
-
thats nice one mate, but could you tell what array does the form uses for the purpose of storing controls. thanks Mian Rashed Inam Khattak
if you reach the code of your frame, you'll see into the constructor (
New()
) a call toInitializeComponent()
. in this function, I found the first line asMe.components = New System.ComponentModel.Container
i so think that they are stocked there. but you still don't answer my question : why don't you use the identification name of each control (which must be unique) ?
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
if you reach the code of your frame, you'll see into the constructor (
New()
) a call toInitializeComponent()
. in this function, I found the first line asMe.components = New System.ComponentModel.Container
i so think that they are stocked there. but you still don't answer my question : why don't you use the identification name of each control (which must be unique) ?
TOXCCT >>> GEII power
[toxcct][VisualCalc]the reason for doing so is that i have almost 13 textboxes on the form and i dont want to control each of them separately. any ways thanks for the help i think this will help my problem to be worked out. thanks once again. Mian Rashed Inam Khattak