473,789 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UserControl Invalidate Problem

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.invalidat e()" at the last line of the
linkClicked event, which seems to do nothing.

Anyone who feel generous enough to enlight me please?
Feb 3 '08 #1
1 1918
On Sat, 02 Feb 2008 22:51:01 -0800, Newbro
<Ne****@discuss ions.microsoft. comwrote:
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
Feb 3 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
12282
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or Invalidate(Rectangle)) flickers in a nasty way when repainting. This does not happen in the Solitare (PC + WinCe) Versions a well as in a Card game where I have the C++ Source. The use of an empty OnPaintBackground brings no visable results.
0
1408
by: lc | last post by:
I use a series of UserControl that get dynamically created and (all) docked (fill) on one form panel. Problem is that I have to call UserControl.BringToFront() more than once to get it to show. This happens even when only one user control has been created and docked. I tried with Show(), Refresh() and Invalidate() but had no luck so far. I gotta be missing something obvious but nothing comes to mind. Any idea anyone? TIA
8
3195
by: Tinus | last post by:
Hello all, I've create a custom control (UserControl) and have a custom Item Collection. The control is a custom calendar which is draw using the Graphics Rectangle etc. functions. It is drawn when the control is painted or resized. When the control is drawn it draws also the items found in the collection. So far so good.... I have 3 questions which I'm unable to find a solution
4
2150
by: steve bull | last post by:
I have created a UserControl and added it to my toolbox. It appears in the toolbox with the icon I created for it. The problem is that when I drag the control onto a form no code is generated. If I manually add the code for creating the control to the form everything works fine. I have created other controls w/o problems and cannot see anything I am doing different in this case. Does anyone have any idea what I could be doing wrong? ...
0
1824
by: JR | last post by:
Hi, i found a user control on the net see code below it is part of VSEssential but I like the coolProgressBar. Zo I want to use it into my program and I always get the error that it can't find the control or the control isn't into the toolbar Who has an idee Jan
1
7199
by: Executor | last post by:
Hi you all, I have created a usercontrol with a filledEllipses on a filledRectangle, using this Paint event: private void myControl_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { SolidBrush aBrush = new SolidBrush(this.BackColor); e.Graphics.FillRectangle(aBrush, 10,10, this.Width - 10, this.Height
4
2942
by: Sugan | last post by:
Hi all, I've created a Custom button control and i'm drawing the graphics for the button when the paint event is fired. I used Invalidate method to redraw the graphics in events like mousemove, click etc. My problem is as follows: I created a test application to test the created custom button control. I had two buttons on the form. When i click on one button 1 a message box is showed. This message box covers one part of the other...
4
4639
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this program is like so: static void Main() {
0
3037
by: raylopez99 | last post by:
Hi, I'm getting into GDI+ Forms 2.0 graphics for C#3 using Visual Studio 2008. One thing I notice: the graphics are really slow and flicker on a Pentium IV, with 2 GB RAM, even with doublebuffering turned on. I did learn tricks such as not invalidating everything, but just the control that is part of the form you are working on (i.e.,
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3703
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.