Results 1 to 5 of 5

Thread: TextBox question..[Resolved - thx bruce]

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    7

    TextBox question..[Resolved - thx bruce]

    I'm using the TextBox control from the "Microsoft Forms 2.0" designer(because it can be transparent) and i want to be able to press for instance a command button and have the textbox scroll. Well unlike normal textbox's there is no TextBox1.hwnd (like Text1.hwnd of normal ones). How do i get the hwnd of this type of textbox?

    VB Code:
    1. Const EM_LINESCROLL = &HB6
    2.  
    3.       Private Declare Function SendMessage Lib "user32" Alias _
    4.       "SendMessageA" _
    5.          (ByVal hWnd As Long, _
    6.           ByVal wMsg As Integer, _
    7.           ByVal wParam As Integer, _
    8.           ByVal lParam As Long) As Long
    9.  
    10. Private Sub Command1_Click()
    11.          Dim lngRet As Long
    12.  
    13.          lngRet = SendMessage([B]TextBox1.hwnd[/B], EM_LINESCROLL, 0, 5&)
    14.       End Sub

    This works on a normal textbox but since the TextBox1 doesn't have a .hwnd property i have no idea how to find the .hwnd of the textbox. WELL thanks in advance!
    Last edited by TuckWat; Dec 11th, 2003 at 02:24 PM.
    Tucker Watson

  2. #2

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    7
    Did i stump people, or is the question unclear? Any feedback would be appreciated.

    Thanks guys.
    Tucker Watson

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    Are you aware of the consequences of using Forms 2.0 in a VB project not to mention the fact of it being illegal to re-distribute.

    INFO: Usage and Redistribution of FM20.DLL

    PRB: "Error 7 - Out of Memory" Error Message From Visual Basic Application Using FM20.DLL

    Regardless, Forms 2.0 controls are window-less controls (like the VB Label control) and thus do not have an hwnd.

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Aaron Young posted an example of a Transparent TextBox, do a search and see if its something you can use



    Edit:

    This may be a place to start.




    Bruce.
    Last edited by Bruce Fox; Dec 11th, 2003 at 04:04 AM.

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    7
    Thanks bruce... and bruce i had no idea that it was illegal to redistribute or that they were "windowless" - but now i do. I guess i'll do transparent textboxes again - thanks guys!
    Tucker Watson

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