Results 1 to 11 of 11

Thread: VB baby needs help!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    96

    Red face VB baby needs help!!

    Hi Guys,

    How to hide, form title

    Is there anything like

    Form1.title=hide?


    Pls help me!

    Smily

  2. #2
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    umm... how bout this:

    VB Code:
    1. frmMain.Caption = ""
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    96
    I do not want the title bar at all, how to remove the title bar??

    Cheers,

    Smily

  4. #4
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    To do this at design time set the Form's BorderStyle = vbNone

    To do this at run time (requires EventVB.dll):

    Code:
    Option Explicit
    
    Dim WithEvents vbLink As EventVB.APIFunctions
    Dim WithEvents vbWnd As EventVB.ApiWindow
    
    
    Private Sub Check1_Click()
    
    If Check1.Value = vbChecked Then
        vbWnd.SetWindowStyle WS_CAPTION, False
        Me.Height = Me.Height + vbLink.System.Metrics(SM_CYCAPTION)
    Else
        vbWnd.UnSetWindowStyle WS_CAPTION, False
        Me.Height = Me.Height - vbLink.System.Metrics(SM_CYCAPTION)
    End If
    
    End Sub
    
    Private Sub Form_Load()
    
    Set vbLink = New EventVB.APIFunctions
    
    Set vbWnd = New EventVB.ApiWindow
    vbWnd.hWnd = Me.hWnd
    
    End Sub
    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  5. #5
    Lively Member FRAIL_KNIGHT's Avatar
    Join Date
    Nov 2001
    Posts
    100

    Unhappy

    Do you want to hide the bar itself, or just the caption??

    Frm.caption=""

    or if you want to hide the bar itself, I think there is a certain property that will hide it. Maybe its the form type or border type, I forget the name of the property, but its there somewhere.

    FRAIL_KNIGHT
    IF Something <> "" Then
    There's Something there...
    ------------------------------------------
    GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
    ------------------------------------------
    The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!

    www.OfficerNegative.com

  6. #6
    Lively Member ccrawford's Avatar
    Join Date
    Nov 2001
    Location
    Liverpool
    Posts
    86

    hide title bar

    in the properties delete the caption title and set the controlbox property to false.
    Colin

  7. #7
    Lively Member FRAIL_KNIGHT's Avatar
    Join Date
    Nov 2001
    Posts
    100
    ya, that's what it was, the controlbox property....
    IF Something <> "" Then
    There's Something there...
    ------------------------------------------
    GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
    ------------------------------------------
    The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!

    www.OfficerNegative.com

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    96

    VB need help!!

    Hi MerrionComputin,

    Didn't I tell you that I am baby in VB6

    Tell me how to drop .dll into my application

    Smily

  9. #9
    Lively Member FRAIL_KNIGHT's Avatar
    Join Date
    Nov 2001
    Posts
    100
    ccrawford's method sounds much easier...
    IF Something <> "" Then
    There's Something there...
    ------------------------------------------
    GWBASIC, QBASIC, QuickBASIC, VB5/6, A little DJGPP C++, and I hate it.
    ------------------------------------------
    The pic u see is the logo of my favorite Christian Punk Band...Officer Negative!!!

    www.OfficerNegative.com

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    96
    Hi FRAIL_KNIGHT,

    You are a star

    It works fine


  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Good ole native VB is just fine with me.
    VB Code:
    1. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    3. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    4.  
    5. Private Const WS_CAPTION = &HC00000          '  WS_BORDER Or WS_DLGFRAME
    6. Private Const GWL_STYLE = (-16)
    7. Private Const SWP_FRAMECHANGED = &H20        '  The frame changed: send WM_NCCALCSIZE
    8. Private Const SWP_NOMOVE = &H2
    9. Private Const SWP_NOSIZE = &H1
    10. Private Const SWP_NOZORDER = &H4
    11.  
    12. Private Function DisplayCaption(ByVal IsDisplayed As Boolean) As Boolean
    13.         Dim MyStyle As Long
    14.        
    15.         MyStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
    16.           If IsDisplayed Then
    17.              MyStyle = MyStyle Or WS_CAPTION
    18.           Else
    19.              MyStyle = MyStyle And Not WS_CAPTION
    20.           End If
    21.          
    22.           If SetWindowLong(Me.hwnd, GWL_STYLE, MyStyle) Then
    23.              If MyStyle = GetWindowLong(Me.hwnd, GWL_STYLE) Then
    24.                 DisplayCaption = True
    25.              End If
    26.          End If
    27.          
    28.          SetWindowPos hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE
    29. End Function
    30.  
    31. Private Sub Form_Load()
    32. 'i wrote this to be a toggle
    33. 'if you say DisplayCaption True it will redisplay it
    34. DisplayCaption False
    35. End Sub

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