![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | External resources and forms designer Hello, I created a class library project to store my images resources. In another project (windows app) I just want to set an image for a toolstripbutton. Where can I write this simple line of code : ToolStripButton1.Image = ExternalResource.ButtonImage So that I can see the image in design mode ? And so that Visual Studio won't create a copy of my image in the form's resx file ? -- Fred foleide@xxxxxx |
My System Specs![]() |
| | #2 (permalink) |
| | Re: External resources and forms designer Hi, You just need to add a Resource File to your ClassLibrary project. Open the resources designer (just double-click on the resx file) and change the 'Access Modifier' property in the designer (located on the top of the designer-> you have a combo box and you can switch from private to public). Then Add a reference to your classlibrary from your windows forms app and you can code something like this: pictureBox1.Image = ExternalResources.Image1; (assuming you have declared the 'using' reference). Frédéric Queudret CTO Mpoware http://www.mpoware.com/ "Fred" <foleide@xxxxxx> wrote in message news:OcBMndU0IHA.4500@xxxxxx Quote: > Hello, > > I created a class library project to store my images resources. > In another project (windows app) I just want to set an image for a > toolstripbutton. > Where can I write this simple line of code : > ToolStripButton1.Image = ExternalResource.ButtonImage > So that I can see the image in design mode ? And so that Visual Studio > won't create a copy of my image in the form's resx file ? > > -- > Fred > foleide@xxxxxx |
My System Specs![]() |
| | #3 (permalink) |
| | Re: External resources and forms designer Dans : news:C0130BFA-3790-4B84-BB0F-ADCE200FF9C4@xxxxxx, Frédéric Queudret écrivait : Quote: > Hi, Quote: > You just need to add a Resource File to your ClassLibrary project. > Open the resources designer (just double-click on the resx file) and > change the 'Access Modifier' property in the designer (located on the > top of the designer-> you have a combo box and you can switch from > private to public). Quote: > Then Add a reference to your classlibrary from your windows forms app > and you can code something like this: > pictureBox1.Image = ExternalResources.Image1; > (assuming you have declared the 'using' reference). I program with vb.NET If I write in the constructor, the image won't appear in Design mode. If I write in the generated code, it appears, but if I make a change and the code is generated again, Visual Studio makes a copy of my image in the form's resx file and change my code. I will simply keep theses resources in the same assembly. I need some external resources elsewhere but it is not so important here. -- Fred foleide@xxxxxx |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| designer | Vista General | |||
| simulate continuous forms & subforms in a windows forms application | .NET General | |||
| Expression Web Designer | Vista General | |||