|
-
Dec 2nd, 2011, 05:46 AM
#1
Thread Starter
Member
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
Last edited by Enveetee; Dec 2nd, 2011 at 06:21 AM.
-
Dec 2nd, 2011, 06:48 AM
#2
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.
-
Dec 2nd, 2011, 07:11 AM
#3
Thread Starter
Member
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...
-
Dec 2nd, 2011, 08:13 AM
#4
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.
-
Dec 2nd, 2011, 08:21 AM
#5
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
-
Dec 2nd, 2011, 08:51 AM
#6
Re: Usercontrol not updating when placed on TabControl pages
Why don't you owner draw a listbox?
Kris
-
Dec 2nd, 2011, 10:57 AM
#7
Thread Starter
Member
Re: Usercontrol not updating when placed on TabControl pages
 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
-
Dec 2nd, 2011, 10:58 AM
#8
Thread Starter
Member
Re: Usercontrol not updating when placed on TabControl pages
 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?
-
Dec 2nd, 2011, 11:48 AM
#9
Re: Usercontrol not updating when placed on TabControl pages
 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.
-
Dec 2nd, 2011, 11:49 AM
#10
Re: Usercontrol not updating when placed on TabControl pages
 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
-
Dec 2nd, 2011, 12:04 PM
#11
Thread Starter
Member
Re: Usercontrol not updating when placed on TabControl pages
 Originally Posted by BlindSniper
Actually you can change both.
Do you have an example pls
-
Dec 2nd, 2011, 12:14 PM
#12
Re: Usercontrol not updating when placed on TabControl pages
do a search for "owner drawn listbox vb" .... should turn up a few results...
-tg
-
Dec 2nd, 2011, 02:42 PM
#13
Thread Starter
Member
Re: Usercontrol not updating when placed on TabControl pages
 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
-
Dec 3rd, 2011, 05:20 AM
#14
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.
-
Dec 3rd, 2011, 05:31 AM
#15
Thread Starter
Member
Re: Usercontrol not updating when placed on TabControl pages
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|