Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / February 2005

Tip: Looking for answers? Try searching our database.

Problem getting designer to create proper code for items in UserControl..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Cummings - 22 Feb 2005 20:05 GMT
I am creating a user control to somewhat mimick the behavior of the left panel in Office 2003. I have a user control that contains a collection of custom objects that represent the panels seen in the navigation panel. My problem is I allow the user to specify an image for each panel but the code generated by the designer does not create a new resource bundle which causes the image to not be available.

Here's the code that is generated:

this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("resource"))), "sh1");

Notice it is referencing a *resources* object but that it doesn't create an entry for that object. This is what I think it's supposed to generate:

1) a resources object if one does not exist:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));

this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("sectionHeader1.Image"))),

What am I doing wrong here? Why doesn't the designer know it needs to generate the resource object?

Please anyone help!!!
TIA,
-=- Kevin
Kevin Cummings - 22 Feb 2005 21:28 GMT
More accurately, I'm having a problem getting the code generator to generate the proper code for an Image property.
 I am creating a user control to somewhat mimick the behavior of the left panel in Office 2003. I have a user control that contains a collection of custom objects that represent the panels seen in the navigation panel. My problem is I allow the user to specify an image for each panel but the code generated by the designer does not create a new resource bundle which causes the image to not be available.

 Here's the code that is generated:

 this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
 this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("resource"))), "sh1");

 Notice it is referencing a *resources* object but that it doesn't create an entry for that object. This is what I think it's supposed to generate:

 1) a resources object if one does not exist:
 System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));

 this.oL2003NavBar1 = new Outlook2003NavigationBar.OL2003NavBar();
 this.sectionHeader1 = new Outlook2003NavigationBar.SectionHeader(((System.Drawing.Bitmap)(resources.GetObject("sectionHeader1.Image"))),

 What am I doing wrong here? Why doesn't the designer know it needs to generate the resource object?

 Please anyone help!!!
 TIA,
 -=- Kevin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.