?
Solved

UserControl in Design Mode has obliques

Posted on 2003-03-13
8
Medium Priority
?
215 Views
Last Modified: 2010-05-01
I have a number of common things I do in every textbox and in every combobox, so rather than add the relevant code to every one of these controls, I have created two UserControls. Rather than make them separate OCXs, I have made them part of the VB project. These have worked perfectly until a few days ago. I can't remember just what I did, but at some point, both of these UserControls have started to misbehave. Whenever I add or change anything on the form, all the instances of these UserControls get overdrawn with obliques. All I have to do is close the form, then when I open it again, the obliques are gone until I make another change to the form. The program works perfectly though. The UserControls perform all the functions they are meant to. Any ideas what is going wrong ?
0
Comment
Question by:robertlees
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Expert Comment

by:saurabhgupta
ID: 8133948
This can occur if the usercontrol is open in design mode. Close the usercontrol design window and the lines should be gone.
0
 
LVL 1

Author Comment

by:robertlees
ID: 8133974
Thanks for your suggestion saurabhgupta, but the usercontrol is not open. My only window is the form that contains instances of the usercontrols. If I add a label to that form, all instances of my usercontrol suddenly get overwritten by obliques.
0
 
LVL 2

Expert Comment

by:saurabhgupta
ID: 8134189
Hi robertlees,
The obliques mean that the usercontrol has been disabled by VB and it cannot execute code. It will not even receive a Terminate event. But I can't figure out the reason for this. Usually I see this happen when:
1. Usercontrol is open in design mode.
2. You have recently added new properties or methods to the usercontrol.
3. There is an error in the usercontrol code.

Try doing a full compile and see if you get any error.

Regards
Saurabh

P.S: To remove the lines you can right-click on form and choose the Update UserControls item on the popup menu to refresh the usercontrol instance on the form.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Accepted Solution

by:
saurabhgupta earned 750 total points
ID: 8134373
0
 
LVL 1

Author Comment

by:robertlees
ID: 8135492
Thanks Saurabh for your comments. I read the Google Group, but nothing seems to yield a solution to my problem. The toolbox icon isn't greyed out - in fact with existing instances of the control 'hatched', I can draw a new instance of the control, and it is not hatched. I was intrigued by the issue of Global variables that might cause a conflict. I certainly would have reference to Globals, but how would this cause a problem ? I always do a Full Compile (ie, Ctrl-F5), and never get an error due to this 'hatching'.
0
 
LVL 3

Expert Comment

by:y2ksw
ID: 8135929
Do you have Source Safe on? Sometimes VSS causes this harmless behaviour on its own.
0
 
LVL 1

Author Comment

by:robertlees
ID: 8139625
Saurabh, your Google link gave me the reason. In both my controls I had a call to a routine in a module. When I removed this call from one of the controls, only the other one continued to have the problem. Trouble is, I really want to retain this call. What I am trying to do is recognise when ANY control on my form gets changed, then I will enabled the SAVE button. Part of the reason for these controls in the first place is wanting to remove the necessity for putting repetitive code like this into every change and click event of all the textboxes and comboboxes on my form. Is there a proper way of doing this ?
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 8151260
See whether that can help


>>Is there a proper way of doing this?


http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20095712.html
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 2 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question