Jump to content
xisto Community
Sign in to follow this  
miCRoSCoPiC^eaRthLinG

Vs.net: "designer Generated Code" Editing Problem Any workarounds ???

Recommended Posts

HI,

This is a very old & well-known bug in Visual Studio 2003 and I hear it's been recitifed in the 2005 version. But till I get my hands on it (which isn't hapenning soon enough) I still got to use the old VS2003. The problem is: if you mess around with the code that lies in the region "Windows Forms Designer Generated Code" - the form controls just VANISH when you load it up in designer mode. They just won't come back however hard you try - and all you're left with is a BLANK form. Not that it hampers with your code from running in any way - but you can't see the layout of your controls anymore and kind of grope around in the dark... Does anybody know any solutions to this ??? Urgently needed if there is one...

Thanks a lot ;)

 

P.S. A little bit of details as to where it's going wrong

-----------------------------------------------------------------

    ......

    ........

 

    'Required by the Windows Form Designer

    Private components As System.ComponentModel.IContainer

 

    'NOTE: The following procedure is required by the Windows Form Designer

    'It can be modified using the Windows Form Designer. 

    'Do not modify it using the code editor.

    Friend WithEvents AxTaskPane As AxtssTaskPane.AxTaskPane

    Friend Shared WithEvents panelMainScreen As System.Windows.Forms.Panel

    ......

    ........

 


Do you see the last line - that's where I've introduced the keyword "Shared" after the "Friend" keywork - and that's what makes all the controls VANISH COMPLETELY from the designer. If I remove the shared keyword and try - all controls are BACK !!! But I NEED to use the shared keyword there for other modules/classes to be able to access and manipulate that panel. This is very funny and extremely inconvenient at the same time.. So, can anyone suggest a workaround ??

Share this post


Link to post
Share on other sites

I have experienced the same problem in my VB.Net Application, and my simplest workaround was to pass the control as a reference to the other modules/classes that needed access to the container.In my given situation it was possible, and achieved the desired effect, but maybe that is not an option in your situation? I know it seems cumbersome, but it works!I hope that helps!

Share this post


Link to post
Share on other sites

Thanks for your reply - infact that's what I exactly did, after being told to get rid of the Shared keyword on vbCity forums... it works all fine now. I simply pass this Panel as a parameter named "Owner" of the type Control to the created class and that created class (which is subclasses from Panel again) attaches itself inside this main panel.. that did the trick :unsure:Regards,m^e

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.