Usercontrol not updating when placed on TabControl pages
Hi
Could someone shed some light on this please
VS2008 VB.NET
I have a usercontrol which has a number of labels on it. The usercontrol acts a bit like a listbox but I can control the background and foreground color of the labels it contains - nothing fancy use it for logging a process - a bit like a scrolling console window.
I have a form with 3 of these controls, Progress, Errors, and a debug logger. Works fine when placed on a form
...until I add a tab control with three paces and place each usercontrol on a tabpage. then random labels are not updated.
Move the UC off the tab control - fine
Move them on - random updates
What am I missing
Help please
Cheers
Re: Usercontrol not updating when placed on TabControl pages
My best guess would be that the error is in your control and that It has something to do with the parent of the control.
Re: Usercontrol not updating when placed on TabControl pages
The data is being added to my control, and I can raise an event which is received by the calling app, it's just the labels in the control are not updated...
Re: Usercontrol not updating when placed on TabControl pages
You would have to look at the code of your usercontrol and you will probably find the problem there. without seeing the actual code all we can do is guess.
Re: Usercontrol not updating when placed on TabControl pages
what happens when you place multiple usercontrols on the form? I bet the same thing would happen... sounds like your usercontrol might have instance issues.
-tg
Re: Usercontrol not updating when placed on TabControl pages
Why don't you owner draw a listbox?
Kris
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
techgnome
what happens when you place multiple usercontrols on the form? I bet the same thing would happen... sounds like your usercontrol might have instance issues.
-tg
Multiple instances on the form work fine, the control only has issues when it's on the tabcontrol
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
i00
Why don't you owner draw a listbox?
Kris
Kris
AFAIK you cannot change the background (or even foreground) colors on a listbox - Is this correct?
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
Enveetee
Kris
AFAIK you cannot change the background (or even foreground) colors on a listbox - Is this correct?
Actually you can change both.
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
Enveetee
Multiple instances on the form work fine, the control only has issues when it's on the tabcontrol
That has got nothing to do with inheritance
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
BlindSniper
Actually you can change both.
Do you have an example pls
Re: Usercontrol not updating when placed on TabControl pages
do a search for "owner drawn listbox vb" .... should turn up a few results...
-tg
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
techgnome
do a search for "owner drawn listbox vb" .... should turn up a few results...
-tg
Thanks for the tip but I can't find a way of changing the background color of each items. Foreground does not seem to be an issued, even multiple colors on a single line (iitem) but can't change the item's background color
Re: Usercontrol not updating when placed on TabControl pages
You asked if it is possible to change the background color of a listbox and yes you can, but you cannot change the background of an individual item. You should be more clear when you post. As for your usercontrol problem you will probably have to post the code to have any hope of someone successfully helping you.
Re: Usercontrol not updating when placed on TabControl pages
Quote:
Originally Posted by
BlindSniper
You asked if it is possible to change the background color of a listbox and yes you can, but you cannot change the background of an individual item. You should be more clear when you post. As for your usercontrol problem you will probably have to post the code to have any hope of someone successfully helping you.
Yeah, you're right, sorry group
I'm currently stripping the control down to the point where I can recreate the problem with the minimum of code, I'll post it once done
Again, apologies
Cheers