Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 26th, 2005, 11:28 AM
Registered User
 
Join Date: Jan 2005
Location: Edmonton, Alberta, Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dunorcaille
Default Changing default icon on forms



Hello all,

I was wondering if someone could help me with a problem I encountered when I was trying to change the default icon (located at the top left corner of the form's title bar) of my VB .Net form. When I went to the form's property window, I scrolled down to icon, then I clicked on the ellipsis to fetch a different icon. I then located the icon I wanted and upon clicking OK to insert the new icon onto my form, I got a message from Microsoft Development Environment saying:"The argument 'picture' must be a picture that can be used as an Icon."

I was, therefore, wondering if someone could please help me solve this problem. In other words, how do you change the default form icon in VB .Net?

Thank you very much!


Dunorcaille
  #2 (permalink)  
Old January 27th, 2005, 05:26 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Dunorcaille,

The problem you are experiencing is not with Visual Studio but with the icon you are using. I've found that some icon editors do not save icons in a standard windows format and have experienced the same problem that you are facing.

I found a new icon editor which I have found to be really robust and easy to use. It's called Axialis IconWorkshop and you can visit their web site at http://axialis.com/iconworkshop/.

Since I started using this icon editor I haven't experience the problem you are facing now.

Thearon
  #3 (permalink)  
Old January 27th, 2005, 09:47 AM
Registered User
 
Join Date: Jan 2005
Location: Edmonton, Alberta, Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dunorcaille
Default

Thank you very much, Thearon. I shall give Axialis a try and see what happens. I seem to recall though that when I was using the earlier version of VB (VB6), I was not getting this problem when I wanted to change the default icon of the form.

Dunorcaille
  #4 (permalink)  
Old January 27th, 2005, 10:23 AM
Registered User
 
Join Date: Jan 2005
Location: Edmonton, Alberta, Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dunorcaille
Default

Now, Thearon, I have encountered another problem. As I was in the process of installing the trial version of Axialis 5.0 on my computer (I run the Windows XP Professional OS), suddenly my computer crashed and I got this big blue screen with a white text on my monitor (BSOD) telling me that a SERIOUS problem occured (of course I could not figure out what the error was, but it may have something to do with my video card hardware) and that I should restart my computer. Anyway since I don't want to create any more damage on my computer, I uninstalled the Axialis software. I encountered that same problem a few weeks ago when I was installing the newest version of Adobe 7.0 and to solve that problem, I had to install a new driver for my video card. After doing that, the problem was solved and I was then able to install Adobe successfully.

Any suggestion for Axialis? Thanks,

Dunorcaille
  #5 (permalink)  
Old January 27th, 2005, 01:52 PM
Registered User
 
Join Date: Jan 2005
Location: Edmonton, Alberta, Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dunorcaille
Default

Thearon,

Just to let you know that I finally was able to change the icon on my VB .Net form without having to install the Axialis software (or any other software such as "MicroAngelo"). I simply had to ensure that I was choosing a picture (or icon) with the correct file extention. You need to pick an icon with the right properties, essentially an icon with the 'ico' file extention.

Thanks a million for your help,

Dunorcaille
  #6 (permalink)  
Old January 28th, 2005, 04:59 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Dunorcaille,

Sorry, I have no suggestions. It sounds like you need a new computer or at the very least need to rebuild your computer (e.g. reinstall all software from scratch).

Thearon
  #7 (permalink)  
Old January 28th, 2005, 09:47 AM
Registered User
 
Join Date: Jan 2005
Location: Edmonton, Alberta, Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Dunorcaille
Default

Hi Thearon,

It's ironic that you suggest I need a new computer, for I have a 'new' computer. You should have seen the one I had before. In any case if you scroll up a little on this topic, you'll notice that I had solved the problem I had with changing the icon on the form. All I had to do was to ensure that I got the correct image type, that is one with an 'ico' extention. Voilà!

Once again, thank you very much!

PS. While we are here (this is off topic now), I was wondering if you could explain to me why I can't get the focus() function to work on loading my form. I would like to get the focus on a particular text box on my form so in the load sub of the form, I wrote a line of code like this:txtComments.Focus(). Unfortunately when I run the program the focus is not on that text box when the form opens. Could you tell me why? Thanks a million.

Dunorcaille
  #8 (permalink)  
Old November 4th, 2011, 08:35 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use this code of lines on load event of from :
Code:
Dim Ico As New System.Drawing.Icon("Test.Ico")
Me.Icon = Ico
for more information
change the default form icon in VB .Net
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MasterPage to other Default Forms sankar2chat ASP.NET 2.0 Professional 1 February 13th, 2008 08:16 AM
Changing Icon during Drag and Drop in treeview muskaanbajaj VB.NET 3 August 3rd, 2006 06:16 AM
Error when changing the default page in Tomcat dogmatix Apache Tomcat 1 April 7th, 2005 03:59 PM
Changing default path for Visual Studio .Net help jlecain VS.NET 2002/2003 1 December 23rd, 2003 04:07 AM



All times are GMT -4. The time now is 10:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.