Results 1 to 4 of 4

Thread: Moving Forms without Title Bar...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    79

    Question

    Can someone help me, by explaining to me how to remove the TitleBar, Controlbox, Min and Max Buttons from a form but still have the form moveable, or at least having the Title bar invisible, but still being able to move the form dragging any part of it.


    Cheers
    The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams

    I know the human being and fish can coexist peacefully. - GWB

    I think we agree, the past is over. - GWB

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Code:
    '
    'set the form's controlbox property = false
    'set the form caption = ""
    
    'Make A Titleless Form Moveable With Mouse Drag
    'Add the following code to the declarations section of a form
    
    Private Declare Function SendMessage Lib "User32" _
    Alias "SendMessageA" (ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    lParam As Any) As Long
    
    Private Declare Sub ReleaseCapture Lib "User32" ()
    Const WM_NCLBUTTONDOWN = &HA1
    Const HTCAPTION = 2
    
    
    'Add this code to the form's MouseMove procedure:
    '
    	Dim lngReturnValue As Long
    	   If Button = 1 Then
    		Call ReleaseCapture
    		lngReturnValue = SendMessage(Form1.hWnd, 				WM_NCLBUTTONDOWN, _
    		HTCAPTION, 0&)
    	End If
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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

    <?>

    stupid smilies..

    HTCAPTION, 0&)

    is HTCAPTION, 0& [closing bracket] )
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    79

    Talking

    Thanks very much HSJ, it works brilliantly.

    The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams

    I know the human being and fish can coexist peacefully. - GWB

    I think we agree, the past is over. - GWB

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