Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to achieve this window style in WinForms?

This is a screen shot from GIMP: window headers

There's a regular window header on the left and a smaller, more compact window type on the right. It's something I see from time to time in programs. How can I create such a window in C#?

like image 907
John NoCookies Avatar asked Dec 30 '11 11:12

John NoCookies


2 Answers

Use the property of your Form object FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;

(also SizableToolWindow if you want the user to be able to resize the form).

like image 179
ken2k Avatar answered Oct 14 '22 10:10

ken2k


Look at the properties of Form in properties window, There is property named Style or Sth like that is a dropdown that you can choose between normal windows, dialog and ...

UPDATE: FormBorderStyle and it's values

  • None No border.
  • FixedSingle A fixed, single-line border.
  • Fixed3D A fixed, three-dimensional border.
  • FixedDialog A thick, fixed dialog-style border.
  • Sizable A resizable border.
  • FixedToolWindow A tool window border that is not resizable. A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB. Although forms that specify FixedToolWindow typically are not shown in the taskbar, you must also ensure that the ShowInTaskbar property is set to false, since its default value is true.
  • SizableToolWindow A resizable tool window border. A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB.
like image 45
Jahan Zinedine Avatar answered Oct 14 '22 11:10

Jahan Zinedine