No titlebar?

Hello
Is there a way to make it so that there is no blue titlebar
I want to make something like this:
http://ww2.nero.com/nero6/img/nero_startsmart_2_big_eng.jpg
where the minimize, maximize, and close buttons are not in the boring
microsoft's blue title bar...

Does anyone know how to do this
Thank You very much
Keehun Nam




Answer this question

No titlebar?

  • yerra

    You can allow the user to move the form by clicking and dragging by using the code from the following link:

    http://www.syncfusion.com/faq/windowsforms/Search/1107.aspx

    You will need to have your own close button to close the form.



  • wda

    Or you can set FormBorderStyle to None.

  • Mosc

    Thank you for your help...
    But I tried...


    Public const Integer WM_NCLBUTTONDOWN = 0xA1 Public const Integer HTCAPTION = 0x2 _ Public static extern Boolean ReleaseCapture() _ Public static extern Integer SendMessage(IntPtr hWnd, Integer Msg, Integer wParam, Integer lParam) Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) If e.Button = Windows.Forms.MouseButtons.Left Then ReleaseCapture() SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0) End If End Sub
     


    the "const" doens't seem to work
    the "DllImport" is not defined
    the "Static" is not a valid on a member variable declaration
    end of statement expected for the fourth line " Boolean .ReleaseCapture
    name "releaseCapture" not declared
    name "SendMessage" is not declared
    name "WM_NCLBUTTONDOWN" is not declared
    name"HTCAPTION" is not declared...

    so how does it work
    Thank You for your help.
    Keehun Nam


  • Delmar

    Thank you for your help...
    But the page included in you form looks like its in C# form...
    I tried to make it into a vb but no clue and success...

    Can you please give one specifically labled for VB if you know of any
    Thank You
    Keehun Nam


  • anita j

    Hi,

    Here's a conversion of it:

    Public const Integer WM_NCLBUTTONDOWN = 0xA1
    Public const Integer HTCAPTION = 0x2
    <DllImport("User32.dll")> _
    Public static extern Boolean ReleaseCapture()
    <DllImport("User32.dll")> _
    Public static extern Integer SendMessage(IntPtr hWnd, Integer Msg, Integer wParam, Integer lParam)
     
    Private  Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
         If e.Button = MouseButtons.Left Then
              ReleaseCapture()
              SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0)
         End If
    End Sub


    cheers,

    Paul June A. Domag


  • abk139

    Hi,

    Just set the form's controlbox property to false and set the form's text property to an empty string in the design time.




    cheers,

    Paul June A. Domag


  • alokt

    well
    I just tried it and It works perfectly but I can't move it or I can't close it without making a button
    EX. Right Click -> Close

    Thank you very much for your help!
    Keehun Nam


  • Bill Horsley

    Hi,

    Sorry for the code. I think I was sleepy at the time. Big Smile
    Well Here's the code I think this should work.



        Public Const WM_NCLBUTTONDOWN As Integer = &HA1
        Public Const HTCAPTION = &H2

        <DllImport("User32.dll")> _
        Public Shared Function ReleaseCapture() As Boolean
        End Function

        <DllImport("User32.dll")> _
        Public Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
        End Function

        Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
            If e.Button = MouseButtons.Left Then
                ReleaseCapture()
                SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0)
            End If
        End Sub


     


    BTW, please import System.Runtime.InteropServices:

    Imports System.Runtime.InteropServices



    cheers,

    Paul June A. Domag


  • pmj58585

    opps... The code is little messed up....
    It sould be...


    Public const Integer WM_NCLBUTTONDOWN = 0xA1
        Public const Integer HTCAPTION = 0x2
            <DllImport("User32.dll")> _
        Public static extern Boolean ReleaseCapture()
            <DllImport("User32.dll")> _
        Public static extern Integer SendMessage(IntPtr hWnd, Integer Msg, Integer wParam, Integer lParam)

        Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
            If e.Button = Windows.Forms.MouseButtons.Left Then
                ReleaseCapture()
                SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0)
            End If
        End Sub

     



  • No titlebar?