Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

UserControl in Design Mode has obliques

Posted on 2003-03-13
8
Medium Priority
?
216 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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

572 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