473,383 Members | 1,859 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,383 software developers and data experts.

Setting Form's Icon at runtime from a ImageList

VJ
I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like to
use the same image list to keep the Forms icon and set the icon. How do I
get this done..

VJ
Nov 20 '05 #1
3 5058
VJ
Found this one.. here is how you do it...

Dim bmp As Bitmap
bmp = ImageList1.Images(1)
Me.Icon = Icon.FromHandle(bmp.GetHicon)
bmp.Dispose()
"VJ" <vi********@yahoo.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like to use the same image list to keep the Forms icon and set the icon. How do I
get this done..

VJ

Nov 20 '05 #2
Hi,

Dim bm As Bitmap = ImageList1.Images(0)

Me.Icon = Icon.FromHandle(bm.GetHicon)

Ken
---------------
"VJ" <vi********@yahoo.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like
to
use the same image list to keep the Forms icon and set the icon. How do I
get this done..

VJ

Nov 20 '05 #3
* "VJ" <vi********@yahoo.com> scripsit:
I am trying to set my Form's Icon property at run time based on certain
parameters. I have a imglist in the form for other purposes I would like to
use the same image list to keep the Forms icon and set the icon. How do I
get this done..


Don't use an imagelist for this purpose. Instead, use an embedded
icon:

<http://groups.google.de/groups?selm=uwt1L0KaDHA.1644%40TK2MSFTNGP10.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

4
by: Carl Scarlett | last post by:
When I display icons in controls from an imagelist, the icons are "corrupted" if they are added from a resource (or a file) but are fine if I add them using the designer at design time. I need to...
4
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was...
2
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error...
11
by: Juan Romero | last post by:
Hey guys, I have an ImageList control that stores my icons. What I need to do is find out if the icon at hand already exists in the ImageList so I dont enter it twice. How can I do that? ...
3
by: QLD_AU | last post by:
Is their a way in a VB.Net application to set all sub form icons to the main form ? or even set all icons to the Application icon, without having to reference the icon as a filename ? With...
6
by: Udi | last post by:
Hi, I have an imagelist initialized in design time with several icons files (.ico). However, when I need to extract an icon (Image) from the Imagelist, I can't convert it back to an icon: ...
1
by: Steph. | last post by:
Hi, I load Icons in an ImageList.To do that I have to convert the Icons in the Bitmap format. But HOW can I get My Icon back in a Usable Icon format ?
3
by: Gardner Andersen | last post by:
I have an imagelist with 7 icons images in the collection. I am trying to assign the icons to the items in a listview. In the designer, the proper icons appear next to the listview items (a fixed...
1
by: =?Utf-8?B?QWRhbQ==?= | last post by:
I'm having a problem loading an Icon into an ImageList. When I load the icon directly it works fine, like this: Icon sourceIcon = << Get an icon from somewhere... >>;...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.