Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

Browse by Tags

All Tags » General » Graphics (GDI+) (RSS)

Sorry, but there are no more tags available to filter with.

  • How do I suspend painting a form until all its controls are initialized?

    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...
  • How do I draw a line to replace the functionality of VB6's Line command?

    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...
  • What are some best practices for drawing and painting in Window Forms?

    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...
  • How do I capture a bitmap of a form?

    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...