UserControl Invalidate Problem

N

Newbro

I have created a usercontrol consisted of a linkLabel and textBox. textBox
visible set to false initially. When I click on linkLabel linkClicked event
fired which set textBox visible to true.

I have added this usercontrol to a form1, however when I click on the
linkLabel of the usercontrol the textBox doesn't show up as expected, even
thou the linkClicked event was fired properly.

I have also added the line "this.invalidate()" at the last line of the
linkClicked event, which seems to do nothing.

Anyone who feel generous enough to enlight me please?
 
P

Peter Duniho

I have created a usercontrol consisted of a linkLabel and textBox.
textBox
visible set to false initially. When I click on linkLabel linkClicked
event
fired which set textBox visible to true.

I have added this usercontrol to a form1, however when I click on the
linkLabel of the usercontrol the textBox doesn't show up as expected,
even
thou the linkClicked event was fired properly.

I suspect you are somehow setting the Visible property on the wrong
control.

The above described behavior works fine when I write a sample program to
do it. I click on the LinkLabel and the TextBox appears, just as intended.

So, you have likely not written the code correctly. However, there's no
way for anyone to offer a suggestion as to what you might have done wrong,
since you didn't post any code.

You should post a concise-but-complete sample of code that reliably
reproduces the problem. Without that, it's not possible to offer any
specific advice.

Pete
 
N

Newbro

Thanks Pete

At least I know my assumption is correct, i went back and check the codes
and realize my textbox was actually obstructed by the label, once I call the
prper bringToFront() I was able to get it to show, stupid me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top