puma Posted August 9, 2004 Posted August 9, 2004 Hi, I'm trying to make a Tab usercontrol (a control with multiple pages from which one can be active at a moment). I have two problems regarding this control: 1. I can't make it respond to click events in design view (I want to be able to place controls on each page in design). 2. I use an ArrayList to keep the TabPages collection, and when I exposed this ArrayList with a property, in the PropertyGrid the word (Collection...) appears near the property, but when I edit it it doesn't show the properties for the pages (it sees the Array Elements as simple objects). Do you know what needs to be done in order for this to work properly? Quote
Administrators PlausiblyDamp Posted August 9, 2004 Administrators Posted August 9, 2004 Is there any reason why you couldn't use the built in tab control? If you want to interact with the property grid then you will need to look at creating a custom TypeConverter - search MSDN for some examples (in fact you may find some in our tutor's corner or code library sections). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
puma Posted August 9, 2004 Author Posted August 9, 2004 Is there any reason why you couldn't use the built in tab control? If you want to interact with the property grid then you will need to look at creating a custom TypeConverter - search MSDN for some examples (in fact you may find some in our tutor's corner or code library sections). The built-in tab control cannot be customized to look the way I want it to. I will search the locations you specified for some examples on using Type Converters. Thank you for your post. Quote
Hamburger1984 Posted August 10, 2004 Posted August 10, 2004 Hi, I'm trying to make a Tab usercontrol (a control with multiple pages from which one can be active at a moment). I have two problems regarding this control: 1. I can't make it respond to click events in design view (I want to be able to place controls on each page in design). you'd need to write a class derived from ControlDesigner for your control.. for an example see the Magic Library and their implementation of a custom tab-control... (you can download it here - once you installed it you have their sources..) 2. I use an ArrayList to keep the TabPages collection' date=' and when I exposed this ArrayList with a property, in the PropertyGrid the word (Collection...) appears near the property, but when I edit it it doesn't show the properties for the pages (it sees the Array Elements as simple objects).[/quote'] Don't use an Arraylist - use your own class derived from CollectionBase!! from that you get such nice features as notification on adding or removing items to/from the collection... (also see the magic-library..) for the collection-issue you might also want to take a look at divil's-article... happy coding! Andreas Quote
puma Posted August 10, 2004 Author Posted August 10, 2004 Thank you, Andreas. That answers both my questions. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.