index
>
.NET Base Class Library
> Restrict adding controls in a panel
Restrict adding controls in a panel
Hi,
How can i restrict adding controls in a panel at design time. This is for window app in .net 2.0.
Lalit Mohan Sharma
Odd question. This worked well:
using System;
using System.Windows.Forms;
public class MyPanel : Panel {
protected override void OnControlAdded(ControlEventArgs e) {
throw new Exception("nope");
}
}
Hans Passant.
Marked As Answer by
Zhi-Xin Ye
MSFT
, Moderator
Wednesday, November 05, 2008 11:25 AM
nobugz
Odd question. This worked well:
using System;
using System.Windows.Forms;
public class MyPanel : Panel {
protected override void OnControlAdded(ControlEventArgs e) {
throw new Exception("nope");
}
}
Hans Passant.
Marked As Answer by
Zhi-Xin Ye
MSFT
, Moderator
Wednesday, November 05, 2008 11:25 AM
nobugz
You can use google to search for other answers
Custom Search
More Threads
how to convert?
SqlBulkCopy.WriteToServer - more details from InvalidOperationException?
How to make random.... random
IO Permissions
Active window
System.OutOfMemoryException when creating a new Thread
Bug HtmlInputRadioButton ???
list view
StreamReader and nulls (\00
Read URL response thru reader
Home
Copyright 2009-2010 by netframeworkdev.com All rights reserved