473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Getting Global Resource of Application

Rather than having to create a new "About" form for every program that I write; I have written a class which will create a new form at runtime with all the objects placed. This has been designed so that the class can be added to any project that I am doing and executed as a new instance - voila, one "About" box.

The problem I am currently having is the ability to display a logo on said form. Normally, images are displayed using:
Expand|Select|Wrap|Line Numbers
  1. pictureBox1.Image = global::<projectname>.Properties.Resources.<resourcename>
The resource will be added to every project I do in the foreseeable future so it will always be named the same. The issue I am having is being to maintain my plug-into-any-project class, since I am unsure how to derive the current project's resources.

I have a method of getting the application (namespace) name using:
Expand|Select|Wrap|Line Numbers
  1. System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
However, this does not seem to be helping me at all.

So basically, I want to be able to stick my class into any project I am working on and have it access the current project's resources and set an image accordingly. This means, I don't want project names hard-coded.

Is this even possible? If so, could someone please shed some light on how it can be done?

Thanks.
Jun 9 '10 #1
1 2865
Plater
7,872 Expert 4TB
Why not just pass the Image in as a parameter when you call the about box.

(Also, did you know VS already has a pre-made AboutBox form class that you can add to your project?)
Jun 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mark4asp | last post by:
What are the best methods for using global constants and variables? I've noticed that many people put all global constants in a file and include that file on every page. This is the best way of...
2
by: newbieaspnet | last post by:
This is a real basic question. How can I use a variable that I have included in global.asax in my webform in a web application? Thanks for your help in advance. Would appreciate any help.
2
by: Dan Bass | last post by:
Environment C#, Asp.Net 2.0, Windows 2000 Server Problem I'm trying to enumerate all the names in the global contacts on the exchange server using CDO / ADO / (whatever I can). In writing an...
6
by: martin | last post by:
Hi, I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx. However what I would like to do is have a single global resource file for the...
0
by: walter | last post by:
Hi there, I guess someone here may be able to help -- I created SqlResourceProviderFactory to retrieve the resource from database instead of resx. I consistently encounter a problem while I'm...
0
by: klemen.verdnik | last post by:
Hi... I'm having some difficulties getting all possible keys from a specific resource class. Let's say I have a file named: MyProj.TranslationStrings.resx in my App_GlobalResources folder ...
1
by: shapper | last post by:
Hello, I need to get a global recource but I have a problem: I only know its full name at runtime. I have an resx file named RSS with 2 strings: News_Title and Catalogue_Title. Now I need...
1
by: swati Tripathi | last post by:
hi all, i m not able to get Global page event.I put debug point on Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) but i m not getting event and control never gone to that...
0
by: Jon Harrop | last post by:
With Windows Forms I used to just spawn a new thread and call: Application.Run(form) but with WPF and .NET 3 I'm now getting an error on the second spawn saying that each AppDomain is only...
4
by: icarus | last post by:
global_vars.py has the global variables set_var.py changes one of the values on the global variables (don't close it or terminate) get_var.py retrieves the recently value changed (triggered right...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.