Click here to Skip to main content
16,004,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can i get i ShowDialog method in UserControl??? Pin
Member 26118817-Dec-03 4:56
Member 26118817-Dec-03 4:56 
Generalho wto get ADO info Pin
xprtguro16-Dec-03 21:09
xprtguro16-Dec-03 21:09 
GeneralRe: ho wto get ADO info Pin
Heath Stewart17-Dec-03 3:48
protectorHeath Stewart17-Dec-03 3:48 
GeneralRe: ho wto get ADO info Pin
xprtguro17-Dec-03 21:35
xprtguro17-Dec-03 21:35 
GeneralRe: ho wto get ADO info Pin
Heath Stewart18-Dec-03 2:54
protectorHeath Stewart18-Dec-03 2:54 
Generalsamury Pin
samury16-Dec-03 17:04
susssamury16-Dec-03 17:04 
GeneralRe: samury Pin
gokselm16-Dec-03 23:19
gokselm16-Dec-03 23:19 
GeneralRe: samury Pin
Heath Stewart17-Dec-03 3:44
protectorHeath Stewart17-Dec-03 3:44 
There's also a shortcut using the right Icon constructor, Icon(Type, string). Like many other constructors (including many attribute constructors), the Type parameter is a type used for resource resolution. For instance, building on your example, lets say that you also had a class in the IconLibrary namespace. Specifying that Type plus "test.ico" in the constructor will cause the CLR to use that Type's namespace and append the resource name. This works a lot like relative paths in relation to directories on a filesystem or in a URL.

So, the same thing would work with less code (and amounts to the same thing):
Icon i = new Icon(typeof(IconLibrary.SomeClass), "test.ico");
form.Icon = i;


Of course, this only works if you have a Type you can reference in that namespace, but I thought I'd mention it because a lot of libraries keep these in the same directories as their respective controls (though not all). In those cases, using this approach is a little easier.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: samury Pin
Anonymous17-Dec-03 15:58
Anonymous17-Dec-03 15:58 
Questiongetting enum integer ? Pin
azusakt16-Dec-03 15:38
azusakt16-Dec-03 15:38 
AnswerRe: getting enum integer ? Pin
Nick Parker16-Dec-03 16:49
protectorNick Parker16-Dec-03 16:49 
AnswerRe: getting enum integer ? Pin
Member 26118817-Dec-03 0:19
Member 26118817-Dec-03 0:19 
GeneralRe: getting enum integer ? Pin
Heath Stewart17-Dec-03 3:39
protectorHeath Stewart17-Dec-03 3:39 
GeneralSaving windows forms created at runtime Pin
kvimal16-Dec-03 12:49
kvimal16-Dec-03 12:49 
GeneralRe: Saving windows forms created at runtime Pin
Colin Angus Mackay16-Dec-03 13:01
Colin Angus Mackay16-Dec-03 13:01 
GeneralRe: Saving windows forms created at runtime Pin
Nigel Savidge17-Dec-03 4:30
Nigel Savidge17-Dec-03 4:30 
GeneralThreads and Controls Pin
Guinness4Strength16-Dec-03 11:59
Guinness4Strength16-Dec-03 11:59 
GeneralRe: Threads and Controls Pin
Mike Ellison16-Dec-03 14:15
Mike Ellison16-Dec-03 14:15 
GeneralRe: Threads and Controls Pin
Heath Stewart17-Dec-03 3:35
protectorHeath Stewart17-Dec-03 3:35 
GeneralMdi problemo Pin
datainjector16-Dec-03 10:09
datainjector16-Dec-03 10:09 
GeneralRe: Mdi problemo Pin
Heath Stewart17-Dec-03 3:29
protectorHeath Stewart17-Dec-03 3:29 
GeneralRe: Mdi problemo Pin
Heath Stewart17-Dec-03 3:32
protectorHeath Stewart17-Dec-03 3:32 
GeneralRe: Mdi problemo Pin
datainjector17-Dec-03 10:15
datainjector17-Dec-03 10:15 
GeneralRemote Debugging Pin
mikemilano16-Dec-03 9:13
mikemilano16-Dec-03 9:13 
GeneralRe: Remote Debugging Pin
Heath Stewart17-Dec-03 3:23
protectorHeath Stewart17-Dec-03 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.