Browse by Tags
All Tags » Appearance » Forms (RSS)
Sorry, but there are no more tags available to filter with.
-
|
See the Rubber Band Effect in a Form sample from Simon Bond at C# Corner that implements this sizing technique. Be sure to read the article Debugging "Rubber Band Effect" , where Zhanbo Sun suggests a modification that handles a problem he spotted...
|
-
|
This code snippet shows how you can move a borderless form. private const int WM_NCLBUTTONDOWN = 0xA1; private const int HTCAPTION = 0x2; [ DllImport( "user32.dll" ) ] public static extern bool ReleaseCapture(); [ DllImport( "user32.dll"...
|
-
|
The framework automatically resizes the form if the current Font size during runtime is different from the font size in design-time. It however doesn't auto size when the resolution changes. But it should be easy for you to accomplish. You could derive...
|
-
|
You can prevent users from resizing a form by setting the FormBorderStyle to FixedDialog and setting the MaximizeBox property to false. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
You can restrict the size of a form by setting it's MaximumSize and MinimumSize properties. This will help you control the maximum and minimum size the form can be resized to. Also note that WindowState property of the form plays a part in how the...
|
-
|
The following code snippet demonstrates how you can make your form cover the whole screen including the Windows Taskbar. // Prevent form from being resized. FormBorderStyle = FormBorderStyle.FixedSingle; // Get the screen bounds Rectangle formrect = Screen...
|
-
|
Follow these steps to introduce Windows XP visual styles into your Windows application. 1. Create a new Windows Application and add some controls to the default form. 2. For every control you place on the form that has a FlatStyle property, set the property...
|
-
|
The .manifest file is not required if you are using .NET FrameWork 1.1. You can now use the application's EnableVisualStyles() method which should called before creating any controls. You also need to ensure that the FlatStyle property of the control...
|
-
|
Microsoft has confirmed that calling the Application.EnableVisualStyles method (in the System.Windows.Forms namespace) in the Main method resulting in some ImageList corruption is a bug. This workaround appears to solve the problem. public virtual void...
|
-
|
Here's what I use it in my code. 1. Set up a form for the user to select their style preferences. If this is not important to your app, go to step 2 and skip step 3. 2. Set up a Preference class. Imports System.Drawing Public Class StylePreferences...
|
-
|
Use the Form.FormBorderStyle property to control a form's border. public void InitCustomForm() { // Adds a label to the form. Label label1 = new Label(); label1.Location = new System.Drawing.Point( 80, 80 ); label1.Name = "label1"; label1...
|
-
|
Check out this MSDN Library article Shaped Windows Forms and Controls in Visual Studio .NET by Seth Grossman of the Visual Studio Team. There are two ways to create non-rectangular windows. The first way is to change the Control.Region property, which...
|
-
|
The opacity property enables you to specify a level of transparency for the form and its controls. See the .NET documentation for Form.Opacity for differences between Opacity and TransparencyKey properties. Opacity only works with Windows 2000 and later...
|
-
|
Set the form's Text and ControlBox properties. form1.Text = string.Empty; form1.ControlBox = false; Contributed from George Shepherd's Windows Forms FAQ
|
-
|
You can download a working project that uses this code. public void CreateMyBorderlessWindow() { FormBorderStyle = FormBorderStyle.None; MaximizeBox = false; MinimizeBox = false; StartPosition = FormStartPosition.CenterScreen; ControlBox = false; } Contributed...
|
-
|
Set the property Form.ControlBox to false. Contributed from George Shepherd's Windows Forms FAQ
|
-
|
Setting Form.Visible to false does not make my main form start up invisibly. How can I make my main form start up invisibly? This problem is discussed in an article in the .NET docs. Search for "Setting a Form to Be Invisible at Its Inception"...
|
-
|
You could do so as shown in the code below : Form form1 = new Form(); Bitmap bmp = imageList1.Images[index] as Bitmap; form1.Icon = Icon.FromHandle(bmp.GetHicon()); Please refer to the sample attached here that illustrates this. Contributed from George...
|