Results 1 to 3 of 3

Thread: Form Inheritance

  1. #1

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    Form Inheritance

    Hi all,

    I've got a very strange problem. Have created a base form (fBase), derived a form from fBase (fBaseDetail), and finally derived a form (fObjects) from fBaseDetail.

    Filled fBaseDetail with some kind of extended standard controls (e.g. TextBoxEx, which derives from the standard TextBox). What happens in a moment? all the extended controls (e.g. TextBoxEx) are gone from the designer! The declarations still appear in the code, but all the properties I've set are gone!

    In the extended controls, I've only added two properties, and Mybase.New() is called in the New() event...

    Is it possible that I had to arrive from the base classes instead of the classes of the standard controls (thus: TextBoxBase instead of Textbox)?

    I don't know, find it very strange.

    ps: form overloading is as strange as well... sometimes controls disappear or are placed completely wrong... Anybody knows how I can avoid thát problem?

    Thanx anyway,

    JMvV

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Form Inheritance

    are only your custom controls missing? or any controls on the form?

    What version of Visual Studio are you using? I have had issues with my custom controls not showing up in the designer before (disappearing is a better word), but I always would get error messages, and it had something to do with compiling in release mode and debug mode and the obj folder that VS.NET creates for compiling your code.

  3. #3

    Thread Starter
    Hyperactive Member JMvVliet's Avatar
    Join Date
    May 2001
    Location
    Papendrecht, Netherlands
    Posts
    310

    Re: Form Inheritance

    Hi!

    Yes! That could be the reason. I've compiled my project once in release mode, every time before in debug mode. And yes, it's only about my custom controls (which are deriving from the standard controls).

    I'm using VS .NET 1.1... I saw in the code that the objects stil exists (Friend Withevents tbTest As Textbox), but that all the positions, whether it does have scrollbars and so on were gone in the code.

    But what about the controls that are on the base form not showing in the correct position on a derived form? I've now set back all the controls I'm using to the base form, b'cause that was a possibility I had, but it's not the most nice one, but I get it to work now...

    JM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width