473,473 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Assign a resource to a Picture Box programatically

Good afternoon,

I would like to display a bitmap in a PictureBox which is stored in a
resource file.

The following code works perfectly:
picUser.Image = My.Resources.ResUserIcon01.x48_Crewmember

From a database the application retrieves a string:
"x48_Crewmember" (or "ResUserIcon01.x48_Crewmember")

How can I display the bitmap in a PictureBox using this string?

I could do ist with the following:
Select Case True
Case strBildname = "x48_Crewmember"
picUser.Image = My.Resources.ResUserIcon01.x48_Crewmember
....
End Select

Because of the number of bitmaps there must be a more elegant way.
Thank you for any hint.
Best regards
Jürgen Heyn, Wilhelmshaven, Germany
May 4 '07 #1
0 1214

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: #Hai | last post by:
Hi, I have a picture box control in my form and I have 2 .GIF (animated GIF image). And I want to display those GIF image in my picture-box (at first, I want the control to show the first image...
4
by: vijaynats | last post by:
Hi I created a simple Windows Control using C#. To change the Display Icon (picture) for the control in the Toolbox i added a 16x16 bmp and marked it as "Embedded Resource". The problem is...
0
by: Alex | last post by:
Howcan I assign the DataKeys property of the datagrid programatically from a datasource not using the property builder? E.g. Data_grid1.DataKeys = ???? a column from the dataset?
0
by: PontiMax | last post by:
Hi, when we used VB 6 to build all kinds of applications we applied the following technique to automatically assign resource strings to ui controls: Each control has a unique resource id (which...
5
by: Jean Christophe Avard | last post by:
Hi! I am designing a database driven application. The main purpose of this application is to print signs and label with plant (botanical) information and a picture of the plant. This is mainly...
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
0
by: CSharper | last post by:
Just curious, When you are in IDE, you are able to add a resource to the project through resource tab. Later this resource can be accessed using the resource manager. One good thing about this...
6
by: LEM | last post by:
Hi, I use a Webbrowser component to display a page that has been generate dynamically from my C# program. This page contains some images that are displayed using HTML code like this: <img...
1
by: TisMe | last post by:
Hi All, I am trying to use resource files to globalize my website application. I had this working fine, working through the API for setting page titles programatically, with the resource files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.