I have an embedded icon resource in my project - I need to reference this
icon for a grid cell. I've tried using the following but it does not work. Any
help
appreciated:
Dim im As System.Drawing.Image
im = CType(getobject("CHECKMRK.ICO"),System.Drawing.Ima ge) <-- Fails here.
g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im) 5 2494
Hi,
Dim ico As Icon
Dim p As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly()
ico = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType,
"Icon1.ico"))
Ken
----------------------
"Wayne Hoover" <wh*****@noemail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... I have an embedded icon resource in my project - I need to reference this icon for a grid cell. I've tried using the following but it does not work.
Any help appreciated:
Dim im As System.Drawing.Image im = CType(getobject("CHECKMRK.ICO"),System.Drawing.Ima ge) <-- Fails here. g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im)
Thanks, Ken.
W.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl... Hi,
Dim ico As Icon
Dim p As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
ico = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType, "Icon1.ico")) Ken
----------------------
"Wayne Hoover" <wh*****@noemail.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... I have an embedded icon resource in my project - I need to reference this icon for a grid cell. I've tried using the following but it does not work. Any help appreciated:
Dim im As System.Drawing.Image im = CType(getobject("CHECKMRK.ICO"),System.Drawing.Ima ge) <-- Fails here. g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im)
* "Wayne Hoover" <wh*****@noemail.com> scripsit: I have an embedded icon resource in my project - I need to reference this icon for a grid cell.
Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:
\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///
'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Hi Herfried --
I tried the prior response and now get this:
g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, chkMarkico)
Value of type 'System.Drawing.Icon' cannot be converted to
'System.Drawing.Image'.
Any help appreciated!
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c4*************@ID-208219.news.uni-berlin.de... * "Wayne Hoover" <wh*****@noemail.com> scripsit: I have an embedded icon resource in my project - I need to reference this icon for a grid cell.
Add the icon file to your project and set its 'Build Action' property to 'Embedded Resource'. You can use the code below to load the icon at runtime:
\\\ foo.Icon = _ New Icon( _ [Assembly].GetExecutingAssembly().GetManifestResourceStream( _ "WindowsApplication1.Ball.ico" _ ) _ ) ///
'WindowsApplication1' is the root namespace of the application, "Ball.ico" is the icon's filename.
-- Herfried K. Wagner [MVP] <URL:http://dotnet.mvps.org/>
* "Wayne Hoover" <wh*****@noemail.com> scripsit: I tried the prior response and now get this:
g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, chkMarkico)
Value of type 'System.Drawing.Icon' cannot be converted to 'System.Drawing.Image'.
Any help appreciated!
Icons are not images for .NET! You may want to use a bitmap instead of
an icon.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jack |
last post by:
I was learning Windows programming in C# using Charles Petzold book,
but this book was written for the older version of .NET. The example
of using icon from embedded resource fails to work when...
|
by: Rogerio Jun |
last post by:
Can I copy a embedded resource icon from a DLL to ohter DLL ?
Rogerio
|
by: carl.manaster |
last post by:
Hi,
In
<http://groups-beta.google.com/group/microsoft.public.dotnet.languages.csharp/msg/05abaf8460c61859>,
back in 2003, "SleazySt" wrote that
> Unfortunately, C# projects can't have...
|
by: Brian Henry |
last post by:
If you embedded an icon into a dll, how would you get access to it form
inside the dll and return it to the calling app?
I know how to return it, just I cant figure out how to access the embedded...
|
by: Wayne Hoover |
last post by:
I have an embedded icon resource in my project - I need to reference this
icon for a grid cell. I've tried using the following but it does not work. Any
help
appreciated:
Dim im As...
|
by: news.microsoft.com |
last post by:
I have an icon that I can reference by the following:
Dim im As System.Drawing.Image
im = im.FromFile(lsapppath & "ChkMrk.ico")
g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im)
The problem...
|
by: Garrett |
last post by:
I'm fairly new to VB .NET and programming in general, and I want to
give my program its own icon without it being a separate file. I have
the icon as part of the project, and its Build Action is...
|
by: Pippo |
last post by:
I've created a c# dll with some classes and i've included some icons that i
can see with ILDASM like namespace.iconfile.ico
I re-use this dll (dll reference) and relative classes in many vb...
|
by: farseer |
last post by:
Hi,
I created a new resouce ("app.resx") in my project and added an icon to
this resource with name "IL_ICON". I would like to use this resource
in some unmanaged code, in particular, with the...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |