Groups | Blog | Home
all groups > vb.net controls > january 2005 >

vb.net controls : Buttons on OwnerDrawn TabPage and TabControl not visible.


Philip Tepedino
1/29/2005 9:06:48 PM
Hello all,

I'm having an issue getting a button to show up on a TabPage control.
Here's my setup.
I have a derived TabControl that uses my own derived, customized TabPages.
The TabControl is set to OwnerDrawFixed and I have code in the DrawItem and
OnPaint events drawing everything. This part works.

My TabPage has a datagrid, which is added to it programatically thru the
constructor. It all works fine, and the designer shows it all great.

My problem comes from adding a Button control. I added it programatically
exactly the same way as the datagrid, brought it to the front, added it to
the Controls collection in the TabPage and all, yet, it is not visible!
(also have all properties, size, location everythign setup)

The weird part is.. if i drag a button from the designer into the TabPage,
it shows fine! But i need it to be there when I instanttiate this derived
TabPage during run time.

Any clues on whats going on?

Any help is greatly appreciated...
thanks,

Philip Tepedino

Mick Doherty
1/30/2005 12:41:40 PM
Without code we are unlikely to be able to help.
Does the same issue arise with a standard tabcontrol?

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


[quoted text, click to view]

AddThis Social Bookmark Button