Results 1 to 5 of 5

Thread: Subclassing...

  1. #1

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Subclassing...

    What the heck is that? Can somebody explain?

    I have studied subclassing in Java and I know OOPS fairly well. Only I have no experience of it with VB.

    More specifically I want to extend the features of a textbox that's within an ActiveX control. Certain properties of the textbox, such as Multiline, Scrollbars etc. are unavailable even inside the ActiveX control as these are readonly at runtime. I want to manipulate them.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Win32 subclassing means that you intercept messages to the control/window before they get processed and do something with it. For example if you want to change a natural behavior of a certain window/control, or to add functionality which is not exposed to the control.

  3. #3

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Thanks.

    After posting that I scouted around the net and looked at a few sites with material on subclassing. It essentially is a technique of putting in your own message handler instead of the concerned window's default one.

    Can you or anyone else then explain how I can get around my problem? I am using a textbox in my activeX control and I want to enable the properties such as Multiline or Scrollbars of the textbox when my ActiveX control will be in design/run mode. But as soon as the ActiveX control is being used in another form in the IDE design mode, it is in Run mode, and the textbox therefore does not let me change the Multiline and Scrollbars property, as they are read-only at runtime. Is there any way I can subclass or use an API function to set these properties on the textbox within my ActiveX control?

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    This could be a hassle. Probably the easiest way to get around your problem is to have 2 textboxes. One that is single lined and the other one as multilined. Then just show the appropriate one depending on the property value. This technique will actually allow you to change style in runtime.

  5. #5

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    I thought about it for a while, but I think I could do it using some SendMessage option. Is that possible?

    Since I am replicating most of the properties of the textbox, using two boxes means I shall have to set any property on both the textboxes.

    Then again, for Multiline, I shall need two boxes, then for the various values of Scrollbars and other design-time properties it soon is more than I can manage.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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