473,545 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.Net - Setting all form icons to the application icon

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 Thanks

Jason
Nov 21 '05 #1
3 21403
Jason,

This answer is so not only for the icons.

Create your own basic form with everything basicly on it, and create from
that inherited forms. (That is an item in the add items in the project
explorer)

I hope this helps,

Cor
Nov 21 '05 #2
"QLD_AU" <Ne**@DigitalSn iper.Net> schrieb:
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 ?


There are different ways to do that:

* You can assign the icon to all forms at designtime.

* You can create a base form that includes the icon and let
all other forms inherit from this base form.

* You can make a reference to the icon or main form available
and assign the icon at runtime, for example, in the forms' constructors:

Providing a reference to an application's main form
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=accessmainf orm&lang=en>

<URL:http://groups.google.d e/groups?selm=Oyz rpoUCFHA.392%40 TK2MSFTNGP14.ph x.gbl>

It's not recommended to assign icons to all forms of an application.
Especially dialogs (forms which are shown modally) typically don't have an
icon at all. Take a look at Microsoft's applications to see when using an
icon in the form's title bar makes sense.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Bob
Just in case this might help you managing icons...

Add some icons to your project, make them embedded resources, then put their
file names in the enum below. Then you can access them easily like so:

Dim i As Icon = Resources.GetIc on(Icons.IconNa me1)

Watch for line breaks...

------BEGIN CODE-------

Imports System.Reflecti on

Public Class Resources

Private Sub New()
End Sub

Public Enum Icons
IconName1
IconName2
IconName3
End Enum

Private Shared RootNameSpace As String = GetType(Resourc es).Namespace

Public Shared Function GetIcon(ByVal Icon As Icons) As Icon
Dim ret As Icon
Dim asm As [Assembly] = [Assembly].GetExecutingAs sembly
Dim Name As String = _
RootNameSpace & "." & System.Enum.Get Name(Icon.GetTy pe, Icon) &
".ico"
Dim s As System.IO.Strea m = asm.GetManifest ResourceStream( Name)
If Not s Is Nothing Then
ret = New Icon(s)
s.Close()
End If
Return ret
End Function

End Class

------END CODE-------

"QLD_AU" <Ne**@DigitalSn iper.Net> wrote in message
news:42******** @duster.adelaid e.on.net...
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 Thanks

Jason

Nov 21 '05 #4

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

Similar topics

3
2601
by: Will Mathies | last post by:
I have changed the icon used for my C# windows form application. Now I am having problems. When my app has several windows open they get grouped on the taskbar. The icon that this group uses is out of date. However I have no way to change it. Changing the application icon or form icons do not seem to help.
3
8147
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my forms? once retrieved can I just set the form Icon? or do I need to do something special? Thanks Wayne
2
2552
by: Elad Gutman | last post by:
Hi Everyone, I'm facing an annoying problem and any help will be most appreciated . .. . I have a main application form and its icon is functioning excellent: it appears both in the taskbar and whenever you switch using the Alt + Tab keys. At a certain point of the code I'm creating a new form, using a different thread for this task in...
6
1500
by: Paul | last post by:
In other development environments i've used the IDE had facilities to create custom icons for the application and files it created. It would be nice to have a custom icon for a created file, but it is more important to give the application its own icon. I've looked in over ten books in VB.net programming and none of them cover this issue....
1
4510
by: quest | last post by:
I created windows application using C#. I tried to replace the default application icon by replacing the app.ico file in the project directory but the application still load the old icon. Can someone helps ? Thanks.
0
508
by: Dick | last post by:
I have a shared project that contains icons and bitmaps that are used throughout my suite of applications. I have to set Form.Icon, PictureBox.Image, etc. using code because the form designer can't see the icons and bitmaps unless they're in the local project. This is only slightly inconvenient compared to the benefits from managing the...
1
2350
by: KK | last post by:
I have a C# application with different projects in the solution. I need to change the application icon based on build configuration. I have different build configurations for branding the application. I can change the icons and splash screens without any problems. The only problem is the Application icon which is used to show in the...
1
7464
by: Avnish | last post by:
Hi, I have created an form based application in c# having some GUI. I have also added localization support to it due to GUI changes for different customers.Now the issue I have the Application icon can be set only through Property page in common properties as is the Output file name. But i need different icons (output file) for different...
1
1635
by: sfirouz | last post by:
Hi: I am new to .net stuff and to make the matter worst, I am converting from Borland to Microsoft world. So I am having real hard time figuring things out in VC++ .net. (I am using VS 2008) here is my questions: 1 - How do I get access to Application Icon at runtime. Lets say I want to change the Icon that is displayed on the taskbar...
0
7434
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7692
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7946
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.