Thanks for the feedback. I'm not sure I have explained things correctly.
I'm trying to setup a simple input box. I know this would be far better off
as a control, but it seems a simple way to learn the inheritance thingy to
start with. When complete it wouldn't take much to convert it anyway.
I want a class, clsInput. This class will have several properties,
UpperCase, NumericOnly, TextOnly, Password, Prompt, etc. And probably a
single function GetInput to return the text entered.
I want the class to load a form and set the input parameters, then accept an
input and return the text entered, ie.
Dim str As String
Dim inp As New clsInput
inp.TextOnly = True
inp.Prompt = "Give me some text!"
str = inp.GetInput
I've managed to half the code between a class and a form, but this seems a
little daft, why have a class and a form if you can do exactly the same with
a form and a couple of public variables.
I would like the class to be able to create the form and the form controls,
(which I can do easily) and have the class control the form while displayed.
The only other problem is, as the form has to be 'ShowDialog' how do I
control clicks and key presses from the class when the form has Modal
control?
Cheers,
Tull.
"Joseph Bittman MCAD" <Ry*********@msn.com> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
July 25, 2005
LOL It has been a long time since I inherited anything (and it was
nice!), but I believe you must go to the form that you are inheriting from
and mark the controls that you want to handle with the Protected modifier.
This way inherited forms can control them, compared to the Private
modifier which only allows the same class. Hope this helps! :-)
--
Joseph Bittman
Microsoft Certified Application Developer
Web Site: http://71.39.42.23
Static IP
"Tull Clancey" <tu**********@btopenworld.com> wrote in message
news:dc**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...I have a class that inherits a form. How can I handle clicks and changes
to controls on the inherited form within my class?
Cheers,
Tull.