Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing a TabControl
Message
From
12/11/2004 11:29:35
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00960845
Message ID:
00960881
Views:
8
OK, whatever works!! <g> I don't have that line in any of my subclassed controls either ... I probably should have mentioned that too.

~~Bonnie


>Thanks Bonnie,
>
>Actually it was this line:
>
>[DesignerAttribute(typeof(System.Windows.Forms.Design.ControlDesigner))]
>
>
>I removed it and it all works ok now.
>
>>Stephane,
>>
>>I've not used a TabControl yet, but I *have* subclassed lots of controls. I think the line that's causing you grief might be:
>>
>>		private void InitializeComponent()
>>		{
>>			System.ComponentModel.Container components = new Container();
>>		}
>>
>>Try removing that line and see what happens.
>>
>>~~Bonnie
>>
>>
>>>I'm tring to subclass a TabControl control and add it to my toolbox, when i try to use it and add pages, i cannot access the pages, what am i doing wrong ?
>>>
>>>Here's the code:
>>>
>>>
>>>using System;
>>>using System.Collections;
>>>using System.ComponentModel;
>>>using System.ComponentModel.Design;
>>>using System.Drawing;
>>>using System.Windows.Forms;
>>>
>>>
>>>namespace Test.GUI
>>>{
>>>
>>>	[ToolboxBitmap(typeof(TabControl))]
>>>	[DesignerAttribute(typeof(System.Windows.Forms.Design.ControlDesigner))]	
>>>	public class _TabControl : System.Windows.Forms.TabControl
>>>	{
>>>		private System.ComponentModel.Container components = null;
>>>
>>>		public _TabControl()
>>>		{
>>>			InitializeComponent();
>>>		}
>>>		private void InitializeComponent()
>>>		{
>>>			System.ComponentModel.Container components = new Container();
>>>		}
>>>	
>>>		protected override void Dispose( bool disposing )
>>>		{
>>>			if( disposing )
>>>			{
>>>				if( components != null )
>>>					components.Dispose();
>>>			}
>>>			base.Dispose( disposing );
>>>		}
>>>	}
>>>}
>>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform