Windows Forms Form

32.1 How can I programmatically maximize or minimize a form?

Use the form's WindowState property.

//minimize

this.WindowState = System.Windows.Forms.FormWindowState.Minimized;

.....

//maximize

this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

32.2 How can I display a pop up a confirmation dialog when the user closes the form?

You can listen to the Form's Closing event, where you can display a MessageBox as show below:

[C#]

private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)

{

if (MessageBox.Show("Do you want to close the application?", "Close Application", MessageBoxButtons.YesNo) == DialogResult.No)

e.Cancel = true;

}

[VB.NET]

Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)

If MessageBox.Show("Do you want to close the application?","Close Application",MessageBoxButtons.YesNo) = DialogResult.No Then

e.Cancel = True

End If

End Sub

32.3 How can I center my form?

You can set the Form's StartPosition property to CenterScreen to achieve this.

32.4 How do I prevent users from resizing a form?

You can prevent the users from resizing a form by setting the FormBorderStyle to FixedDialog and setting the MaximizeBox property to false.

32.5 How do I programmatically set an image as Form's Icon ?

You could do so as shown in the code below :

[C#]

Form form1 = new Form();

Bitmap bmp = imageList1.Images[index] as Bitmap;

form1.Icon = Icon.FromHandle(bmp.GetHicon());

[VB.NET]

Dim form1 As Form = New Form()

Dim bmp As Bitmap = imageList1.Images(index) as Bitmap

form1.Icon = Icon.FromHandle(bmp.GetHicon())

Please refer to the sample attached here that illustrates this.

32.6 How can I add items to the System Menu of a form.

To do this, you can use use iterop to access the GetSystemMenu and AppendMenu Win32 APIs. You also need to override the form's WndProc method to catch and act on the menu message. This idea was posted in the Microsoft newsgroups by Lion Shi. Here are some sample projects.

32.7 How can I have a form with no title bar, but yet keep the resizing borders?

Set your form's Text and ControlBox properties.

myForm.Text = "";

myForm.ControlBox = false;

32.8 I don't want to have the Close box on my form's title bar. How do I remove this system menu box?

Set the property Form.ControlBox to false.

32.9 How do I change my application's icon?

In the Solution Explorer window, you'll see a file called app.ico in your project. This file contains your application icon. You can change this to a different file in the project properties screen which you see by right-clicking the project node in the Solution Explorer, and selecting Properties..

32.10 How can I tell if a form is closed from the controlbox (system menu) or from a call to Form.Close?

One way to do this is to override the form's WndProc method and check for WM_SYSCOMMAND and SC_CLOSE. Looking for WM_CLOSE in the override is not sufficient as WM_CLOSE is seen in both cases. A sample is available for download (C#, VB).

public const int SC_CLOSE = 0xF060;

public const int WM_SYSCOMMAND = 0x0112;

//_closeClick is a bool member of the form initially set false...

// It can be tested in the Closing event to see how the closing came about.

protected override void WndProc(ref System.Windows.Forms.Message m)

{

if(m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)

this._closeClick = true;

base.WndProc(ref m);

}

32.11 I have two forms. How can I access a textbox on one form from the other form?

One way to do this is to make the TextBox either a public property or a public field. Then you will be able to access it through the instance of its parent form. So, if TextBox1 is a public member of FormA and myFormA is an instance of FormA, then you can use code such as

[VB.NET]

Dim strValue as String = myFormA.TextBox1.Text

[C#]

string strValue = myFormA.TextBox1.Text;

anywhere myFormA is known. Here is a VB project illustrating this technique.

32.12 How do I create a non-modal top level form that always stays on top of all the app's windows (like the VS.Net find dialog)?

Make your main form the "Owner" of the form in question. Refer to Form.Owner in class reference for more information.

[C#]

findReplaceDialog.Owner = this; // Your main form.

findReplaceDialog.TopLevel = false;

[VB.Net]

findReplaceDialog.Owner = Me ' Your main form.

findReplaceDialog.TopLevel = False

32.13 How can I display a form that is 'TopMost' for only my application, but not other applications?

You can do this by setting the child form's TopMost to False and setting its Owner property to the Main Form.

[C#]

Form1 f = new Form1();

f.TopMost = false;

f.Owner = this;

f.Show();

[VB.NET]

dim f as New Form1()

f.TopMost = False

f.Owner = Me

f.Show()

32.14 How do I automatically resize the Form when the screen resolution changes between design-time and runtime?

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 a custom Form, provide a "ScreenResolutionBase" property that could return the current screen resolution (Screen.PrimarScreen.Bounds will give you this). This value will get serialized in code during design time. Then during runtime in the Form's OnLoad you could check for the current screen resolution and resize the Form appropriately.

32.15 How can I ensure that my form will always be on the desktop?

To set or control the location of the form using desktop coordinates, you can use the SetDeskTopLocation property. You can do this by setting the child form's TopMost to False and setting its Owner property to the Main Form.

[C#]

this.SetDesktopLocation(1,1);

[VB.NET]

Me.SetDesktopLocation(1,1)

32.16 How can I restrict or control the size of my form?

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 form can be resized.

[C#]

//Minimum width = 300, Minimum height= 300

this.MinimumSize = new Size(300, 300);

//Maximum width = 800, Maximum height= unlimited

this.MaximumSize = new Size(800, int.MaxValue);

[VB.NET]

'Minimum width = 300, Minimum height= 300

Me.MinimumSize = New Size(300, 300)

'Maximum width = 800, Maximum height= unlimited

Me.MaximumSize = New Size(800, Integer.MaxValue)

32.17 How can I prevent a form from being shown in the taskbar?

You need to set the form's ShowInTaskbar property to False to prevent it from being displayed in the Windows taskbar.

[C#]

this.ShowInTaskbar = false;

[VB.NET]

Me.ShowInTaskbar = False

32.18 How do I prevent a user from moving a form at run time?

The following code snippet (posted in the Windows Forms FAQ forums) shows how you can prevent a user from moving a form at run time:

[C#]

protected override void WndProc(ref Message m)

{

const int WM_NCLBUTTONDOWN = 161;

const int WM_SYSCOMMAND = 274;

const int HTCAPTION = 2;

const int SC_MOVE = 61456;

if((m.Msg == WM_SYSCOMMAND) && (m.WParam.ToInt32() == SC_MOVE))

{

return;

}

if((m.Msg == WM_NCLBUTTONDOWN) && (m.WParam.ToInt32() == HTCAPTION))

{

return;

}

base.WndProc (ref m);

}

[VB.NET]

Protected Overrides Sub WndProc(ByRef m As Message)

const Integer WM_NCLBUTTONDOWN = 161

const Integer WM_SYSCOMMAND = 274

const Integer HTCAPTION = 2

const Integer SC_MOVE = 61456

If (m.Msg = WM_SYSCOMMAND) &&(m.WParam.ToInt32() = SC_MOVE) Then

Return

End If

If (m.Msg = WM_NCLBUTTONDOWN) &&(m.WParam.ToInt32() = HTCAPTION) Then

Return

End If

MyBase.WndProc( m)

End Sub

32.19 How can I create a non rectangular form?

This MSDN article titled Shaped Windows Forms and Controls in Visual Studio .NET shows how you can create non rectangular forms.

32.20 How can I make my form cover the whole screen including the TaskBar?

The following code snippet demonstrates how you can make your form cover the whole screen including the Windows Taskbar.

[C#]

// Prevent form from being resized.

this.FormBorderStyle = FormBorderStyle.FixedSingle;

// Get the screen bounds

Rectangle formrect = Screen.GetBounds(this);

// Set the form's location and size

this.Location = formrect.Location;

this.Size = formrect.Size;

[VB.NET]

' Prevent form from being resized.

Me.FormBorderStyle = FormBorderStyle.FixedSingle

' Get the screen bounds

Dim formrect As Rectangle = Screen.GetBounds(Me)

' Set the form's location and size

Me.Location = formrect.Location

Me.Size = formrect.Size

32.21 How can I move a Borderless form?

This code snippet shows how you can move a borderless form.

[C#]

public const int WM_NCLBUTTONDOWN = 0xA1;

public const int HTCAPTION = 0x2;

[DllImport("User32.dll")]

public static extern bool ReleaseCapture();

[DllImport("User32.dll")]

public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);

private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

ReleaseCapture();

SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);

}

}

32.22 How do I force a Windows Form application to exit?

Your main form is an object of type System.Windows.Forms.Form. Use its Close method to exit the application. If you wish to Exit from a Form's constructor, this will not work. A workaround is to set a boolean flag that you can later check in the Form's Load method to call Close if required.

Another way is to use the Application.Exit() method.

32.23 How do I set the default button for a form?

Set the form's AcceptButton property. You can do this either through the designer, or through code such as

Form1.AcceptButton = button1;

32.24 How do I get an HWND for a form?

See the Control.Handle property which returns the HWND. Be careful if you pass this handle to some Win32 API as Windows Forms controls do their own handle management so they may recreate the handle which would leave this HWND dangling.

(from sburke_online@microsoft..nospam..com on microsoft.public.dotnet.framework.windowsforms)

32.25 How can I detect if the user clicks into another window from my modal dialog?

Use the Form.Deactivate event:

this.Deactivate += new EventHandle(OnDeactivate);

//...

private void OnDeactivate(object s, EventArgs e)

{

this.Close();

}

(from sburke_online@microsoft..nospam..com on microsoft.public.dotnet.framework.windowsforms)

32.26 How do I create a form with no border?

Use the Form.FormBorderStyle property to control a form's border.

public void InitMyForm()

{

// Adds a label to the form.

Label label1 = new Label();

label1.Location = new System.Drawing.Point(80,80);

label1.Name = "label1";

label1.Size = new System.Drawing.Size(132,80);

label1.Text = "Start Position Information";

this.Controls.Add(label1);

// Changes the border to Fixed3D.

FormBorderStyle = FormBorderStyle.Fixed3D;

// Displays the border information.

label1.Text = "The border is " + FormBorderStyle;

}

(From the .NET Framework SDK documentation)

32.27 How do I prevent a Form from closing when the user clicks on the close button on the form's system menu?

Handle the form's Closing event.

private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)

{

if( NotOkToClose() )

e.Cancel = true; //don't close

}

32.28 How do I display a splash screen type form, one with only client area (no border or titlebar)?

You can download a working project that uses this code.

public void CreateMyBorderlessWindow()

{

this.FormBorderStyle = FormBorderStyle.None;

this.MaximizeBox = false;

this.MinimizeBox = false;

this.StartPosition = FormStartPosition.CenterScreen;

this.ControlBox = false;

}

32.29 How do I get the window handle (HWND) of my form or control?

Use the Control.Handle property.

32.30 How can I make sure I don't open a second instance modeless dialog that is already opened from my main form?

One way to do this is to maintain a list of opened modeless dialogs, and check this list before you open a new one to see if one is already present.

If you open all these modeless dialog's from the same 'main' form, then you can use the OwnedForms property of that main form to maintain this list of opened dialogs. Below are some code snippets that suggest how you must go about this. Note that your dialog forms need to be able to turn off the ownership. This is done below by adding an Owner field to the dialog form.

//sample code that either opens a new dialog or displays an already opened dialog

private void button1_Click(object sender, System.EventArgs e)

{

foreach ( Form f in this.OwnedForms )

{

if (f is Form2)

{

f.Show();

f.Focus();

return;

}

}

//need a new one

Form2 f2 = new Form2();

this.AddOwnedForm(f2);

f2.Owner = this;

f2.Show();

}

//code for form2

public class Form2 : System.Windows.Forms.Form

{

private System.Windows.Forms.Label label1;

public Form Owner;

.......

.......

private void Form2_Closing(object sender, System.ComponentModel.CancelEventArgs e)

{

Owner.RemoveOwnedForm(this);

}

}

32.31 Is there a way to halt a screen from painting until all the controls on the form are initialized?

Shawn Burke responded to this question in a posting on microsoft.public.dotnet.framework.windowsforms newsgroup. 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.

int paintFrozen;

private const int WM_SETREDRAW = 0xB;

[DllImport("User32")]

private static extern bool SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);

private bool FreezePainting

{

get { return paintFrozen > 0; }

set {

if (value && IsHandleCreated && this.Visible)

{

if (0 == paintFrozen++)

{

SendMessage(Handle, WM_SETREDRAW, 0, 0);

}

}

if (!value)

{

if (paintFrozen == 0)

{

return;

}

if (0 == --paintFrozen)

{

SendMessage(Handle, WM_SETREDRAW, 1, 0);

Invalidate(true);

}

}

}

}

32.32 How do I return values from a form?

Add public properties to your form. Then these properties can be accessed by any object that creates an instance of your form.

32.33 How can I easily manage whether controls on my form are readonly or not?

One way is to place all the controls into a single GroupBox and then use the GroupBox.Enabled property to manage whether the controls are editable or not.

32.34 The controls that I've try to add to my form at runtime don't show up. What's wrong?

Make sure you implemented and executed code similar to the InitializeComponent method that VS adds to your Windows Forms project for controls added during design time. Recall that InitializeComponent() is called from your Forms constructor to create the controls, size, position and show the controls, and finally add the controls to the form's Controls collection. So, your code at runtime should also implement these same steps. In particular, don't forget the this.Controls.AddRange call that adds your new controls to the form's Controls collection.

32.35 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". The idea is to startup the application in a different module than your main form. Then the application and main form can have indiependent lifetimes. Sample code is given in the referenced article.

32.36 How to make a form transparent?

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.

32.37 How can I create an instance of a Form class just from knowing its name in a string?

You can use the System.Reflection.Assembly.CreateInstance method to create a form from its name. Below is a code snippet. The name in the textbox has to be the full name including its namespace. So if there is a class named Form2 in namespace MyCompanyName, then the textbox would contain MyCompanyName.Form2. This snippet also assumes that the class is defined in the current executing assembly. If not, you would have to create an instance of the assembly that contains the class instead of calling the static method GetExecutingAssembly. As noted on this board, using reflection in this manner might affect performance.

You can download working samples (VB.NET, C#).

[C#]

try

{

Assembly tempAssembly = Assembly.GetExecutingAssembly();

// if class is located in another DLL or EXE, use something like

// Assembly tempAssembly = Assembly.LoadFrom("myDLL.DLL");

// or

// Assembly tempAssembly = Assembly.LoadFrom("myEXE.exe");

Form frm1 = (Form) tempAssembly.CreateInstance(textBox1.Text);// as Form;

frm1.Show();

}

catch(Exception ex)

{

MessageBox.Show("Error creating: "+ textBox1.Text);

}

[VB.NET]

textBox1.Text = "MyNameSpace.Form2"

......

Try

Dim tempAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()

' if class is located in another DLL or EXE, use something like

' tempAssembly = Assembly.LoadFrom("myDLL.DLL")

' or

' tempAssembly = Assembly.LoadFrom("myEXE.exe")

Dim frm1 As Form = CType(tempAssembly.CreateInstance(textBox1.Text), Form) ' as Form;

frm1.Show()

Catch ex As Exception

MessageBox.Show("Error creating: " + ex.ToString())

End Try




© 2001-06 Copyright George Shepherd.

33. Windows Forms CheckedListBox FAQ Home

33.1 How do I check/uncheck all items in my checkedlist?



33.1 How do I check/uncheck all items in my checkedlist?

To check all items, you can use code such as:

C#

for( int i=0 ; i <>

{

myCheckedListBox.SetItemChecked(i, true);

}

VB.NET

Dim i as Integer

For i = 0 To myCheckedListBox.Items.Count - 1

myCheckedListBox.SetItemChecked(i, True)

Next

}




© 2001-06 Copyright George Shepherd.

34. Windows Forms MDI FAQ Home

34.1 How can I create an MDI application in the .NET framework with C#?

34.2 I have an MDI application with several child forms. The child form's Activated event is not being fired consistently as different child forms are activated. What's wrong?

34.3 In an MDI application, the MDI child's MaximumSize and MinimumSize properties don't seem to take effect. How can I restrict the size of my MDI child?

34.4 How do I check to see if a child form is already displayed so I don't have two instances showing?

34.5 I need to perform certain custom processing whenever an MDI child form is added to/removed from the MDIContainer form. How do I determine this?

34.6 How do I paint in my mdi container, a logo, for example?

34.7 How do I make my child Form fill the entire mdi client without being maximized?

34.8 How can I change the background of my MDI Client container?



34.1 How can I create an MDI application in the .NET framework with C#?

This is one of the Quick Start Samples that ships with VS.Net.

34.2 I have an MDI application with several child forms. The child form's Activated event is not being fired consistently as different child forms are activated. What's wrong?

In .Net 1.0, the child forms do not get the Form.Activated event (only the parent MDI). To catch MDI children being activated, listen to the Enter/Leave events of that child Form or listen to the Form.MdiChildActivate event in the parent Form.

In 1.1 the child Forms do get the Activated event.

34.3 In an MDI application, the MDI child's MaximumSize and MinimumSize properties don't seem to take effect. How can I restrict the size of my MDI child?

It appears that this behavior is a bug that will be corrected in a future .NET release.

You can control the size of your child form by adding a Layout event handler for it. Here is a code snippet that imposes the minimum size that you set in its properties. You can also handle it by overriding the form's WndProc method as explained in this Microsoft KB article.

[C#]

private void Document_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)

{

if(this.Bounds.Width <>

this.Size = new Size(this.MinimumSize.Width, this.Size.Height);

if(this.Bounds.Height <>

this.Size = new Size(this.Size.Width, this.MinimumSize.Height);

}

[VB.NET]

Private Sub Document_Layout(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout

If (Me.Bounds.Width <>

Me.Size = New Size(Me.MinimumSize.Width, Me.Size.Height)

End If

If (Me.Bounds.Height <>

Me.Size = New Size(Me.Size.Width, Me.MinimumSize.Height)

End If

End Sub

34.4 How do I check to see if a child form is already displayed so I don't have two instances showing?

Here are two ways you can do this.

i) Within the parent MDI form, use code such as this:

// MyChildForm is the one I'm looking for

MyChildForm childForm = null;

foreach(Form f in this.MdiChildren)

{

if(f is MyChildForm)

{

// found it

childForm = (MyChildForm) f;

break;

}

}

if( childForm != null)

{

childForm.Show();

childForm.Focus();

}

else

{

childForm = new MyChildForm();

childForm.MdiParent = this;

childForm.Show();

childForm.Focus();

}

ii) Here is a second solution suggested by John Conwell that implements a singleton pattern on the child form.

In the MDI Child form put this code in (where frmChildForm is the MDI child form you want to control)

//Used for singleton pattern

static frmChildForm childForm;

public static ChildForm GetInstance

{

if (childForm == null)

childForm = new frmChildForm;

return childForm;

}

In the Parent MDI form use the following code to call the child MDI form

frmChildForm childForm = frmChildForm.GetInstance();

childForm.MdiParent = this;

childForm.Show();

childForm.BringToFront();

The first time this code is called, the static GetInstance method will create and return an instance of the child form. Every other time this code is called, the GetInstance method will return the existing instance of the child from, stored in the static field childForm. If the child form instance is ever destroyed, the next time you call GetInstance, a new instance will be created and then used for its lifetime.

Also, if you need constructors or even overloaded constructors for your MDI Child Form, just add the needed parameters to the GetInstance function and pass them along to the class constructor.

34.5 I need to perform certain custom processing whenever an MDI child form is added to/removed from the MDIContainer form. How do I determine this?

MDIContainer forms have an MDIClient child window and it is to this MDIClient window that MDI child forms are parented. The MDIClient's ControlAdded/ControlRemoved events will be fired whenever a child form is added or removed. You can subscribe to these events and add the required processing code from within the handlers.

// From within the MDIContainer form, subscribe to the MDIClient's ControlAdded/ControlRemoved events

foreach(Control ctrl in this.Controls)

{

if(ctrl.GetType() == typeof(MdiClient))

{

ctrl.ControlAdded += new ControlEventHandler(this.MDIClient_ControlAdded);

ctrl.ControlRemoved += new ControlEventHandler(this.MDIClient_ControlRemoved);

break;

}

}

protected void MDIClient_ControlAdded(object sender, ControlEventArgs e)

{

Form childform = e.Control as Form;

Trace.WriteLine(String.Concat(childform.Text, " - MDI child form was added."));

}

protected void MDIClient_ControlRemoved(object sender, ControlEventArgs e)

{

Trace.WriteLine(String.Concat(e.Control.Text, " - MDI child form was removed."));

}

34.6 How do I paint in my mdi container, a logo, for example?

You should not try listening to your MDI container Form's Paint event, instead listen to the Paint event of the MDIClient control that is a child of the mdi container form. This article provides you a detailed example: Painting in the MDI Client Area

34.7 How do I make my child Form fill the entire mdi client without being maximized?

Here is how it can be done. This takes into account all docked controls (including menus) in the mdi parent form.

[C#]

private void FillActiveChildFormToClient()

{

Form child = this.ActiveMdiChild;

Rectangle mdiClientArea = Rectangle.Empty;

foreach(Control c in this.Controls)

{

if(c is MdiClient)

mdiClientArea = c.ClientRectangle;

}

child.Bounds = mdiClientArea;

}

[VB.Net]

Private Sub FillActiveChildFormToClient()

Dim child As Form = Me.ActiveMdiChild

Dim mdiClientArea As Rectangle = Rectangle.Empty

Dim c As Control

For Each c In Me.Controls

If TypeOf c Is MdiClient Then

mdiClientArea = c.ClientRectangle

End If

Next

child.Bounds = mdiClientArea

End Sub

34.8 How can I change the background of my MDI Client container?

The default behavior is to make the client container use the Control color from the Control panel. You can change this behavior by making the MDI Client container use the form's BackColor and Image. To do this, after the call to InitializeComponents(), add the code below. You can also download a working MDI Client project that has this code in it.

//set back color

foreach(Control c in this.Controls)

{

if(c is MdiClient)

{

c.BackColor = this.BackColor;

c.BackgroundImage = this.BackgroundImage;

}

}




© 2001-06 Copyright George Shepherd.

35. Windows Forms In IE FAQ Home

35.1 Where can I get information on hosting Windows Forms Controls in IE?

35.2 How do I clear the download cache in my client machine?

35.3 How can I use a WinForms Control in IE?

35.4 What are some common gotchas while trying to embed a Windows Forms Control in IE?

35.5 What are some common UI limitations while running code in the Internet Zone?



35.1 Where can I get information on hosting Windows Forms Controls in IE?

These articles should give you some introduction to hosting WinForms Controls in IE: Using Windows Forms Controls in Internet Explorer Host Secure, Lightweight Client-Side Controls in Microsoft Internet Explorer

35.2 How do I clear the download cache in my client machine?

The following command line will do the trick:

gacutil /cdl

35.3 How can I use a WinForms Control in IE?

You cannot use a WinForms Control directly in IE, you will have to instead derive from it and then use the derived instance from a custom assembly.

35.4 What are some common gotchas while trying to embed a Windows Forms Control in IE?

The issues listed here are pertaining to code running in IE in the default Internet Zone.


1) You cannot view Controls inside IE using the 1.0 framework (when running with the permissions in the default Internet Zone). This is however possible with the 1.1 (Everett) framework.

2) Use only one . in the assembly file name and "Assembly Name"(in Project Properties Dialog). For example, "Syncfusion.Shared.dll" is an invalid dll name, but "Shared.dll" is valid.

3) Signed assemblies couldn't be loaded.

35.5 What are some common UI limitations while running code in the Internet Zone?

1) Cannot override methods like WndProc, ProcessCmdKey, etc in a derived Control. The class ref for a particular property will let you know about the permission requirements.

2) Cannot call Control.Parent.

3) Cannot call Control.Focus() method.

36. Windows Forms Smart Client FAQ Home

36.1 Where are the getting started info. on Smart Client Deployment?



36.1 Where are the getting started info. on Smart Client Deployment?

Here is some information (provided by Lubos in the newsgroups): http://www.fawcette.com/vsm/2002_09/magazine/columns/desktopdeveloper/ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet10142001.asp http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/default.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms11122002.asp

No comments: