Here are some frequently asked questions about Windows Forms and their answers.
Browse by Tags
All Tags » Graphics (GDI+) (RSS)
-
|
The following example explains how to correctly sync system font changes and make the dynamic change in your applciation. Hook UserPreferenceChanged Set the Form font again when this event is raised Unhook from UserPreferenceChanged in form's Dispose...
|
-
|
I set the wait cursor using Cursor.Current = Cursors.WaitCursor;. Why does does it disappear before I want it to? Setting the Current property changes the cursor and stops the processing of mouse events. Setting the cursor back to Cursors.Default restarts...
|
-
|
System.IO.Stream stream = null; try { string curName = "WindowsApplication1.Cursor1.cur"; stream = GetType().Assembly.GetManifestResourceStream(curName); this.Cursor = new Cursor( stream ); } catch ( Exception ex ) { MessageBox.Show(ex.Message...
|
-
|
protected void WriteCursorToFile( Cursor cursor, string fileName ) { TypeConverter converter = TypeDescriptor.GetConverter( typeof( Cursor ) ); byte[] blob = converter.ConvertTo( cursor, typeof( byte[] ) ) as byte[]; if ( blob == null ) { MessageBox.Show...
|
-
|
There is not currently a way to do this built into the framework, but WM_SETREDRAW will do what you're looking for. It can't be called recursively, so here's code for a property you can add to your form to handle it. A VB sample is also available...
|
-
|
Try this code: Dim g as Graphics g = frmMain.CreateGraphics() g.DrawLine(Pens.Black, new Point(0,0), _ new Point(frmMain.ClientRectangle.Width), frmMain.ClientRectangle.Height) g.Dispose() This should draw a line from the upper left to the bottom right...
|
-
|
Check out Painting techniques using Windows Forms for the Microsoft .NET Framework by Fred Balsiger on WindowsForms.net . It is a good basic discussion of how to get the best performance from Windows Forms drawing. His hints include leveraging the power...
|
-
|
You can P/Invoke the BitBlt function from gdi32.dll to handle this problem. using System; using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.Windows.Forms; class CustomForm : Form { [ DllImport( "gdi32...
|