Making a custom "TabControl like" control

rot13

Regular
Joined
Jun 12, 2004
Messages
53
I want to make a control, mainly for options forms, that is like a tab control, but uses a different style 'page selector', which will be a button bar type of control. To be honest though, I'm not any good at control development, and I need to get this thing done asap... today if possible.

First off, I've been working on the button bar part of it, but I don't know how to make the TypeConverter work properly, so I keep getting an exception of something like 'Can't convert ButtonBar.ButtonBarItems[] to ButtonBar.ButtonBarItems[]' or something like that. Any help there would be appreciated. I'll get the exact exception message for you later.

Secondly, I know I need a designer to let me 'click' the buttons on the button bar at design time to switch between container controls. I don't know how to do this, but I'll do a little bit of reading. If you have any tips as far as that goes, it would be helpful.

Thanks
 
I've redesigned the control. I have four classes. ContainerButtonBar, ContainerButtonBarDesigner, ContainerButtonBarPage, and ContainerButtonBarPageDesigner. I have a property 'Pages' of type List<ContainerButtonBarPage> in ContainerButtonBar.

I'm now getting the following error messages at design time after I try to add the control to the form.

---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'ContainerButtonBar'. The error message follows:

'System.Runtime.Serialization.SerializationException: Type 'System.Windows.Forms.ContainerControl' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)

at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)

at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()

at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)

at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)

at System.Runtime.Se...'
---------------------------
OK
---------------------------


---------------------------
Microsoft Visual Studio
---------------------------
Code generation for property 'Pages' failed. Error was: 'Type 'System.Windows.Forms.ContainerControl' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.'
---------------------------
OK
---------------------------


Help! I don't know what to do...

:confused:

EDIT:

I've taken off the inheritance to ContainerControl in the ContainerButtonBarPage class for now, and I get this exception on the form that i put the control on.

Object of type 'aDeVIX.Irc.Presentation.ButtonBar.ContainerButtonBarPage[]' cannot be converted to type 'aDeVIX.Irc.Presentation.ButtonBar.ContainerButtonBarPage[]'.

I assume this is because I don't have a TypeConverter... right? But that's a problem... cause I don't know how to make one work...
 
Last edited:
Back
Top