Click here to Skip to main content
15,901,122 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: resource Pin
Luc Pattyn28-Dec-10 23:39
sitebuilderLuc Pattyn28-Dec-10 23:39 
AnswerRe: resource Pin
Alan Burkhart29-Dec-10 3:40
Alan Burkhart29-Dec-10 3:40 
QuestionWhere is my mistake in SQL Pin
ivo7525-Dec-10 7:35
ivo7525-Dec-10 7:35 
AnswerRe: Where is my mistake in SQL Pin
Dr.Walt Fair, PE25-Dec-10 8:03
professionalDr.Walt Fair, PE25-Dec-10 8:03 
GeneralRe: Where is my mistake in SQL Pin
ivo7525-Dec-10 8:22
ivo7525-Dec-10 8:22 
AnswerRe: Where is my mistake in SQL Pin
Eddy Vluggen25-Dec-10 8:14
professionalEddy Vluggen25-Dec-10 8:14 
AnswerRe: Where is my mistake in SQL Pin
Dave Kreskowiak25-Dec-10 18:55
mveDave Kreskowiak25-Dec-10 18:55 
QuestionCustom icon on an executable compiled with VBCodeProvider? [Solved] Pin
Saul Johnson22-Dec-10 5:54
Saul Johnson22-Dec-10 5:54 
Hello Everybody!

I've been puzzling all day over how I would go about giving a custom application icon to a VB.NET executable compiled from VB.NET 2010 code using the VBCodeProvider class.

My application compiles VB.NET source code into a .NET executable like this:

Dim MyCodeProvider As New VBCodeProvider
Dim MyCompilerOptions As New CompilerParameters
MyCompilerOptions.GenerateExecutable = True

MyCodeProvider.CompileAssemblyFromSource(MyCompilerOptions, MySourceCode)


That's working great, but I can't find a way to assign custom application icons to the generated executables. I've tried using a ResourceWriter to create a resources file with the icon in it and embedding that in the executable like so:

Dim MyResourceWriter As New ResourceWriter("C:\AppResources.resources")
MyResourceWriter.AddResource("APPICON", New Drawing.Icon("C:\AppIcon.ico"))
MyResourceWriter.Generate()
MyResourceWriter.Close()

MyCompilerOptions.EmbeddedResources.Add("C:\AppResources.resources")


However, though the generated executable increases in size (which leads me to think that the icon data is in there somewhere), the icon still doesn't show up as the application icon in Windows Explorer.

I'm a real novice at using resource files, and I just can't get it to work. Can anybody see what I'm doing wrong?

Thanks in advance!

MrWolfy Big Grin | :-D
modified on Saturday, December 25, 2010 5:30 PM

AnswerRe: Custom icon on an executable compiled with VBCodeProvider? Pin
Eddy Vluggen25-Dec-10 8:04
professionalEddy Vluggen25-Dec-10 8:04 
GeneralRe: Custom icon on an executable compiled with VBCodeProvider? Pin
Saul Johnson25-Dec-10 11:32
Saul Johnson25-Dec-10 11:32 
GeneralRe: Custom icon on an executable compiled with VBCodeProvider? Pin
Eddy Vluggen25-Dec-10 12:18
professionalEddy Vluggen25-Dec-10 12:18 
QuestionWord 2007 open xml Pin
B Mac Gregor22-Dec-10 3:35
B Mac Gregor22-Dec-10 3:35 
AnswerRe: Word 2007 open xml Pin
Eddy Vluggen25-Dec-10 8:02
professionalEddy Vluggen25-Dec-10 8:02 
QuestionDataGridView's Cell as Multiline Vb.Net 2008 Pin
Paramu197322-Dec-10 0:55
Paramu197322-Dec-10 0:55 
AnswerRe: DataGridView's Cell as Multiline Vb.Net 2008 Pin
dan!sh 22-Dec-10 3:12
professional dan!sh 22-Dec-10 3:12 
GeneralRe: DataGridView's Cell as Multiline Vb.Net 2008 Pin
Paramu197322-Dec-10 20:15
Paramu197322-Dec-10 20:15 
QuestionGetting filename of current window/application [SOLVED] Pin
Yance Lawang21-Dec-10 23:32
Yance Lawang21-Dec-10 23:32 
AnswerRe: Getting filename of current window/application Pin
Eddy Vluggen22-Dec-10 0:37
professionalEddy Vluggen22-Dec-10 0:37 
AnswerRe: Getting filename of current window/application Pin
Dave Kreskowiak22-Dec-10 2:17
mveDave Kreskowiak22-Dec-10 2:17 
GeneralRe: Getting filename of current window/application Pin
Yance Lawang22-Dec-10 3:59
Yance Lawang22-Dec-10 3:59 
GeneralRe: Getting filename of current window/application Pin
Dave Kreskowiak22-Dec-10 7:50
mveDave Kreskowiak22-Dec-10 7:50 
GeneralRe: Getting filename of current window/application Pin
Yance Lawang23-Dec-10 3:05
Yance Lawang23-Dec-10 3:05 
QuestionCheck Box Problem Pin
Leinad_3021-Dec-10 12:11
Leinad_3021-Dec-10 12:11 
AnswerRe: Check Box Problem Pin
Luc Pattyn21-Dec-10 12:25
sitebuilderLuc Pattyn21-Dec-10 12:25 
AnswerRe: Check Box Problem Pin
Dr.Walt Fair, PE21-Dec-10 15:56
professionalDr.Walt Fair, PE21-Dec-10 15:56 

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.