What does Handle refer to in this case

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SamSpade

    What does Handle refer to in this case

    If I have a class that inherits from, say RichTextBox and in the derived
    class I refer to Handle, does it refer to the RichTextBox class or the
    derived class?

    I'm wondering if the derived class gets it's own handle or is there only one
    for both classes (after all there is only one window)?


    Thanks


  • Armin Zingler

    #2
    Re: What does Handle refer to in this case

    " SamSpade" <stillprogrammi ng@REMOVEaol.co m> schrieb[color=blue]
    > If I have a class that inherits from, say RichTextBox and in the
    > derived class I refer to Handle, does it refer to the RichTextBox
    > class or the derived class?[/color]

    The Handle is the "native" window handle that windows returns when a new
    window/control is created.
    [color=blue]
    > I'm wondering if the derived class gets it's own handle or is there
    > only one for both classes (after all there is only one window)?[/color]

    As there is only one instance, there is only one handle. If you create an
    instance of RichtextBox, it has it's own handle. If you create an instance
    of a class derived from RichtextBox, it has also it's own handle.

    --
    Armin

    How to quote and why:



    Comment

    • SamSpade

      #3
      Re: What does Handle refer to in this case

      Thanks, I was pretty sure that was the case but needed confirmation because
      of something strange that is happening.

      Something that worked before I split a usercontrol into a derived class and
      a usercontrol no longer works.


      "Armin Zingler" <az.nospam@free net.de> wrote in message
      news:40bc97eb$0 $12506$9b622d9e @news.freenet.d e...[color=blue]
      > " SamSpade" <stillprogrammi ng@REMOVEaol.co m> schrieb[color=green]
      > > If I have a class that inherits from, say RichTextBox and in the
      > > derived class I refer to Handle, does it refer to the RichTextBox
      > > class or the derived class?[/color]
      >
      > The Handle is the "native" window handle that windows returns when a new
      > window/control is created.
      >[color=green]
      > > I'm wondering if the derived class gets it's own handle or is there
      > > only one for both classes (after all there is only one window)?[/color]
      >
      > As there is only one instance, there is only one handle. If you create an
      > instance of RichtextBox, it has it's own handle. If you create an instance
      > of a class derived from RichtextBox, it has also it's own handle.
      >
      > --
      > Armin
      >
      > How to quote and why:
      > http://www.plig.net/nnq/nquote.html
      > http://www.netmeister.org/news/learn2quote.html
      >[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: What does Handle refer to in this case

        * " SamSpade" <stillprogrammi ng@REMOVEaol.co m> scripsit:[color=blue]
        > Thanks, I was pretty sure that was the case but needed confirmation because
        > of something strange that is happening.
        >
        > Something that worked before I split a usercontrol into a derived class and
        > a usercontrol no longer works.[/color]

        Feel free to post parts of the code if you are not able to solve the problem.

        --
        Herfried K. Wagner [MVP]
        <URL:http://dotnet.mvps.org/>

        Comment

        • SamSpade

          #5
          Re: What does Handle refer to in this case

          It'll take some doing to get it small enough but I'm going to try.[color=blue]
          >
          > Feel free to post parts of the code if you are not able to solve the[/color]
          problem.[color=blue]
          >
          > --
          > Herfried K. Wagner [MVP]
          > <URL:http://dotnet.mvps.org/>[/color]


          Comment

          Working...