G
Guest
Hi all,
I have a question about a custom control. I'm very new to c# programming so
forgive me if the question is very basic.
I want to create some kind of a keyboard, with some buttons, such that when
the user clicks a button, that button's text will be added to a textbox. For
example, if the button's text is "A", when it's clicked - "A" will be added
to the textbox. I want to have this functionality in some forms.
I thought of creating a custom control for a single button, and implement
its click event to display the button's text property. After that, make about
15 copies of that control, each one with a different text, and position them
in the order that I want, and make another control out of the whole thing.
Then I can use this control in all of the forms where I need this keyboard.
1. Do I need to inherit the single button when building the keyboard in
order to change the text property?
2. Is it basically the right way to do it?
3. I want to write to a different textbox every time (according to the user
clicks on the textbox). I thought of using some global textbox variable
together with the textbox GotFocus event, so that whenever a GotFocus event
triggers, the global variable will be the textbox that has got focus. Can it
be done this way? How do I do this?
Thanks a lot
I have a question about a custom control. I'm very new to c# programming so
forgive me if the question is very basic.
I want to create some kind of a keyboard, with some buttons, such that when
the user clicks a button, that button's text will be added to a textbox. For
example, if the button's text is "A", when it's clicked - "A" will be added
to the textbox. I want to have this functionality in some forms.
I thought of creating a custom control for a single button, and implement
its click event to display the button's text property. After that, make about
15 copies of that control, each one with a different text, and position them
in the order that I want, and make another control out of the whole thing.
Then I can use this control in all of the forms where I need this keyboard.
1. Do I need to inherit the single button when building the keyboard in
order to change the text property?
2. Is it basically the right way to do it?
3. I want to write to a different textbox every time (according to the user
clicks on the textbox). I thought of using some global textbox variable
together with the textbox GotFocus event, so that whenever a GotFocus event
triggers, the global variable will be the textbox that has got focus. Can it
be done this way? How do I do this?
Thanks a lot