Results 1 to 14 of 14

Thread: Label1.hwnd ???

  1. #1
    Guest
    It doesn't exist, but is there a way around it???? I need that hwnd!!!

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You are absolutely right, there isn't a hwnd, and the reason is because there isnt'. In other words, a label doesn't have a hwnd.

    In fact the caption is written directly on the form so there isn't a window to which it could have a handle
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    I know there is no hwnd for label. I'm asking if there is a way around it (I need to use the label in subclassing but without the hwnd it's not possible)

    P.S. What with that caption????? What caption?????

  4. #4
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Why exactly do you need it for.

    There are more than two ways to get deep pe...

    I've said too much.
    Courgettes.

  5. #5
    Guest
    I need to create a mouse_in and mouse_out event. I did it with command button, picture box, form, frame etc. But all of them had the hwnd. I have a bunch of labels (a lot actually) and I need to create a mouse_in and out event. Without the hwnd - well it's not doable.

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Could you set the Label1.tag = 333
    or whatever and access the label by its tag number?
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7
    Guest
    He is using it for subclassing, I dont think you can use the Tag property in subclassing... unfortunatly

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Make a usercontrol that acts like a label, but is a windowed control.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Guest
    HeSaidJoe: Can't do. In my subclassing procedure I have something like this:
    Code:
    Select Case hwnd
    Case frmMain.hwnd
    Case frmOption.hwnd
    Case frmMain.cmdAdd.hwnd
    End Select
    the hwnd is part of the subclassing (as far as I know you need to have hwnd to subclass unless I'm mistaken). So as you see I need that [beep] hwnd

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The UserControl has the capability to export its hWnd.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Don't know if it's of any use to you but I found this on
    another site as an answer to finding the hwnd can't be found
    'sample of mouse over mouse off

    It might give you a spark or something and if not...just more useless code for your situtation.

    [code]

    Private Sub Form_Load()
    Picture1.Height = 1
    Picture1.Width = 1
    End Sub

    Private Sub Label1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
    If State = 1 Then
    lblmsg = "Mouse left label1"
    Picture1.Drag 0
    End If
    End Sub

    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    lblmsg = "Mouse is over label1"
    Picture1.Left = Label1.Left + X
    Picture1.Top = Label1.Top + Y
    Picture1.Drag
    End Sub
    [code]




    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  12. #12
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I think you could have a textbox to act like a label if you remove the borders, or ofcouse you could make a usercontrol for that
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  13. #13
    Guest
    Why not just place it in a PictureBox?

  14. #14
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    because it would take up more resource than a textbox would
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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