Results 1 to 3 of 3

Thread: No window title but title in taskbar solution I found

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    353

    No window title but title in taskbar solution I found

    I hope this helps someone, because it helped me.

    My prior first method was using the following:

    • Set Form to "Fixed Dialog"
    • Type a window title
    • Add following code to form:


    Code:
        Protected Overrides ReadOnly Property CreateParams() As CreateParams
            Get
                Dim cp As CreateParams = MyBase.CreateParams
                cp.Style = cp.Style And Not &HC00000 ' WS_CAPTION
                Return cp
            End Get
        End Property
    However the problem with the above solution is that in the designer now, you have to move the form objects around OTHERWISE it shows up like a huge gap either above or below in the form (the form extends in the wrong direction) very ugly in the designer then (you start not seeing your objects or have to live with live form being sized differently). This probably after the fact that the titlebar disappears in runtime but shows up in in the designer.

    Then I found this better, easier and cleaner solution:

    Set form to FixedDialog, erase Window Title.

    Import this:

    Code:
        <Runtime.InteropServices.DllImport("user32.dll")>
        Public Function SetWindowText(ByVal hwnd As IntPtr, ByVal windowName As String) As Boolean
        End Function
    Add in mybase.load the following for your form:

    Code:
            SetWindowText(Me.Handle.ToInt32, "User Information")
    Additionally you can add an icon too

    Code:
            Me.Icon = My.Resources.favicon
    Give it a try, very simple and does the job right without molesting the form output. You get a titlebarless window form that has a Taskbar/ALT+TAB title and an icon.

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    Re: No window title but title in taskbar solution I found

    Wrong section. Il inform the admins to move it.
    My Github - 1d3nt

  3. #3
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: No window title but title in taskbar solution I found

    Moved to Code Bank which is the right place for code submissions.

    Thanks for submitting this.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

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