Resolved Restrict Component Code to Runtime Only

drmccoy

New member
Joined
Jul 29, 2011
Messages
2
Programming Experience
1-3
Hi Board.

This is my first post here. I've been working with Visual Basic 2008 Express Edition for about 1 year now, so I'm not all too experienced, I'd be glad if you could give a detailed answer if possible.

Here's my problem. I have developed a class extension for the TabControl which hides and shows tabs when you click on a specific tabPage. It does work just fine, my problem is though that this functionality is also availible in the designer. Thus, once I create a TabControl with a specific amount of tabPages, it leads to an automatic shortening of the displayed tabPages. Once I click the tabPage to display all tabs, a new tabPage (on which to click to shorten the amount of displayed tabPages again) is automaticly generated (as it should be during runtime), but this one gets also saved into the form.designer file, which leads to the appearance of the "show less tabs" tabPage by default, since it's generated in the designer file.

I know that there are some ways to control the behavoir of your classes (a collegue of mine has once used a consted #if run_on_mono to change the behaviour of the class depending on the current IDE), I was wondering wether it was possible to restrict the code I have written to runtime only, in order to avoid the generation of unwanted tabPages in the designer file.

I've been looking around the internet, but google only hits me up with "How to generate components at runtime" articles, which won't solve my problem of course.

Greetings,
drmccoy
 
Last edited:
Wow, that was actually a rather easy answer. Thank you very much, and sorry for posting this in the wrong subsection :)
 
Back
Top