:: Home

  login:         
  passwords:  

Winforms Interview Questions

Windows Forms Deployment
Windows Forms Controls
Windows Forms Data Binding
Windows Forms Datagrid
Windows Forms Docking
Windows Forms Keyboard Handling
Windows Forms Layout
Windows Forms Licensing
Windows Forms Menus
Windows Forms Mouse Handling
Windows Forms from MFC
Windows Forms from VB6
Windows Forms Patterns
Windows Forms Printing
Windows Forms Resources
Windows Form Scrolling
Windows Forms Tips
Windows Forms Common Dialogs
Windows Forms Listbox
Windows Forms ComboBox
Windows Forms Rich TextBox
Windows Forms ListView
Windows Forms TreeView
Windows Forms Button
Windows Forms TabControl
Windows Forms TextBox
Windows Forms MDI
Windows Forms Cursors
Windows Forms WebBrowser
Windows Forms PictureBox
Windows Forms Form
Windows Forms MDI
Windows Forms In IE
GDI+Bitmaps&Images
GDI+Font
GDI+Color
GDI+Brushes
GDI Drawing Tips
GDI+ from GDI
GDI Paths Regions
GDI+Pens
Interioerability WIn32
Tools Metadata Viewers
Design Time Serialization
Design Time Custom Designers
Design Time Tips
Design Time Type Editors
Vs.Net Tips
Vs.Net Debugging
Vs.Net Macros
Framework Tips General
Framework Tips Events
Framework Tips General IO
Framework Tips Strings
Framework Tips Threading
Tool Resource Editor
Design Time UI
Framework Tips CGI
Framework Tips XML

WPF Interview Qs

SilverLight Interview Qs

SAP Interview Questions

Oracle Interview Questions

PHP Interview Questions

Ajax Interview Questions

IIS 7.0

OOP Interview Questions

Ruby Interview Questions

Sql Server Interview Questions

SharePoint 2007 Questions

Microsoft Crm Questions

GDI+ Paths & Regions

The General Winforms Interview Questions consists the most frequently asked questions in Winforms. This list of 100+ questions guage your familiarity with the Winforms platform. The q&a have been collected over a period of time from various blogs, forums and other similar Winforms sites

39. GDI+ Paths & Regions

    39.1 What is a GraphicsPath?
    39.2 How can I create non-rectangular windows?
    39.3 Is there a imagemap like control in Windows Forms?

39.1 What is a GraphicsPath?

The GraphicsPath class represents a series of connected lines and curves.


39.2 How can I create non-rectangular windows?

There are 2 ways to create non-rectangular windows:
1) The Control.Region property (Form inherits this of course):
[CS]
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(0,0,100,100);
gp.AddRectangle(50,50,100,100);
this.Region = new Region(gp);
[VB.NET]
Dim gp As New GraphicsPath()
gp.AddEllipse(0, 0, 100, 100)
gp.AddRectangle(50, 50, 100, 100)

Me.Region = New [Region](gp)
2) Use the Form.TransparencyKey property. This tells the form not to paint any pixels that match the color of the TransparencyKey. So you can make your fancy skin bitmap, then set the TransparencyKey to be, say Color.Red, then all the pixels that are RGB(255,0,0) will be transparent.

39.3 Is there a imagemap like control in Windows Forms?

There isn't one out of the box. But check out this codeproject article for a control that provides this functionality.

Copyright 2007, Megasolutions Ltd