|
-
Sep 30th, 2003, 11:26 AM
#1
Thread Starter
I wonder how many charact
Inherit Designer for custom control
Ok, I am 'trying' to make a SuperTabPage that inherits from TabPage. So I make a new class, inherit TabPage.
Of course, the problem is, you can't use the IDE to help you visually layout the controls in the tab page.
There is however, a TabPageDesigner class that if implemented properly by using the <Designer> attribute ... ie. <Designer("System.....") Public My Class SuperTabPAge...
should allow you to visually configure the visual aspect using the IDE.
So, does anyone know jack about assigning .Net Designers to a class?
Last edited by nemaroller; Sep 30th, 2003 at 12:09 PM.
-
Sep 30th, 2003, 12:21 PM
#2
Addicted Member
I believe tabpages only get a designer when they have been added to a tabcontrol
-
Sep 30th, 2003, 01:08 PM
#3
Thread Starter
I wonder how many charact
Well, as funny as it may seem, TabControlDesigner is also marked as private. The base designer for both is IDesigner, so I believe the syntax is probably incorrect.
-
Sep 30th, 2003, 01:10 PM
#4
Addicted Member
can't you just add the controls in code??
-
Sep 30th, 2003, 01:26 PM
#5
Thread Starter
I wonder how many charact
Sure... I could just create a Form using code without a designer too.. but then what's the point of having a Visual IDE?
You mentioned that tabpages need a tabcontrol as parent, and that's obvious, but something I may have overlook as I was trying to implement this. But regardless, now that I know TabControlDesigner is private and cannot be accessed, how the heck does .Net expect anyone to visually design this tab page?
-
Sep 30th, 2003, 01:37 PM
#6
Addicted Member
what I mean is, you can't double click a tabpage on the toolbox and place one on a form, and start adding controls. The only way you can add controls in design-mode to a tabpage, is when the tabpage has been added in design view to the tabcontrol. I have created a custom tabcontrol, so I have been through all this crap. Fortunatley I got away with using the standard tabpages, hiding the buttons and drawing my own.
-
Sep 30th, 2003, 06:21 PM
#7
Thread Starter
I wonder how many charact
Well, I have found a way to do it, just simply tricking the IDE into thinking its a UserControl.
See I needed to create a class that inherited TabPage, so I can use the same tabpage elsewhere in our project, and simply use a line of code like:
VB Code:
TabControl1.TabPages.Add(myTabPageClass)
But basically, all I did was add a new User Control, and then lay out my componenets, and then go into code view and simply switch Inherits UserControl to Inherits TabPage, and that did the trick.
-
Sep 30th, 2003, 07:11 PM
#8
Addicted Member
Re: Inherit Designer for custom control
Originally posted by nemaroller
Of course, the problem is, you can't use the IDE to help you visually layout the controls in the tab page.
I thought your problem was not being able to place other controls on your tabpage, not putting your own TabPages into the tab control's tabpage collection.
-
Oct 1st, 2003, 10:32 AM
#9
Thread Starter
I wonder how many charact
Re: Re: Inherit Designer for custom control
Originally posted by PeteD
I thought your problem was not being able to place other controls on your tabpage, not putting your own TabPages into the tab control's tabpage collection.
That was my problem. Solved it by tricking the IDE by switching Inherits TabPage to Inherits UserControl to lay out the controls, and then switching it back to Inherits Tabpage when I was finished.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|