List Info

Thread: Create Form Event




Create Form Event
country flaguser name
United States
2007-08-23 09:42:56

hi guyz

i m making form which is like registration form, it has large number
of labels and textboxes, so i have 3 question..

1> how to give scroll bar to window form ?
bcoz i m using many textboxes & labels so obviously cant show in
800X600 resolution and i dont want to make 2 or 3 window of same
registration form.

2> how to handle event of all control in a form in just one common
(single) procedure?
i m not using array of textbox and dont want to write same code
for evey textboxes Event. it takes too much time for writing event
handler & changing any code if any needs in futuer. so can any1
helping in making common event handling of all control in Form.

3> how to respond of any key press in entrie form ?
if i write key press of that form and if any textbox of that form
gets the focus then that key press event doesnt working. so can any1
help in key pressed in that entire form

__._,_.___
.

__,_._,___
RE: Create Form Event
country flaguser name
United States
2007-08-23 18:14:39

> 1> how to give scroll bar to window form ?
> bcoz i m using many textboxes & labels so obviously cant show in
> 800X600 resolution and i dont want to make 2 or 3 window of same
> registration form.

Place them on a picture box and scroll the contents of the picture box.
See the "ScrollForm.zip" here:
http://reliableanswers.com/vb/samples.asp

> 2> how to handle event of all control in a form in just one common
> (single) procedure?
> i m not using array of textbox and dont want to write same code
> for evey textboxes Event. it takes too much time for writing event
> handler & changing any code if any needs in futuer. so can any1
> helping in making common event handling of all control in Form.

You SHOULD rewrite your code to use control arrays. Failure to do so
will balloon the size and complexity of your resulting program.

However, if you absolutely must continue with the way you've done
things, you can setup the events you want for each object and relay the
events to another procedure. Make sure you pass the object name or
something to it so you can apply contextual results to each. The easy
way to do this is by passing the object reference to the object, through
a parameter. Again, this wouldn't be necessary if you were using control
arrays.

> 3> how to respond of any key press in entrie form ?
> if i write key press of that form and if any textbox of that form
> gets the focus then that key press event doesnt working. so can any1
> help in key pressed in that entire form

Set the form "keypreview=true".

Regards,

Shawn K. Hall
VBHelp Moderator
http://ReliableAnswers.com/

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )