Click here to Skip to main content
15,894,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to compare textbox string with data base field Pin
Luc Pattyn12-Oct-09 1:00
sitebuilderLuc Pattyn12-Oct-09 1:00 
AnswerRe: how to compare textbox string with data base field Pin
Md. Marufuzzaman12-Oct-09 1:24
professionalMd. Marufuzzaman12-Oct-09 1:24 
AnswerRe: how to compare textbox string with data base field Pin
OriginalGriff12-Oct-09 3:08
mveOriginalGriff12-Oct-09 3:08 
QuestionDynamically created Icon for Number in Taskbar Pin
stancrm11-Oct-09 23:30
stancrm11-Oct-09 23:30 
AnswerRe: Dynamically created Icon for Number in Taskbar Pin
freakyit11-Oct-09 23:46
freakyit11-Oct-09 23:46 
GeneralRe: Dynamically created Icon for Number in Taskbar Pin
stancrm11-Oct-09 23:54
stancrm11-Oct-09 23:54 
GeneralRe: Dynamically created Icon for Number in Taskbar Pin
freakyit11-Oct-09 23:59
freakyit11-Oct-09 23:59 
AnswerRe: Dynamically created Icon for Number in Taskbar Pin
Luc Pattyn12-Oct-09 0:04
sitebuilderLuc Pattyn12-Oct-09 0:04 
Hi,

this draws into a bitmap:
Bitmap bm=new Bitmap(100,100);
Graphics g=Graphics.FromImage(bm);
g.FillRectangle(...);
g.DrawString(....);


and this turns a bitmap file into a simple icon file:
string filename=...;
try {
	Bitmap bm=(Bitmap)Image.FromFile(filename);
	if(bm.Width!=32 || bm.Height!=32) {
		bm=new Bitmap(bm, 32, 32);
	}
	Icon icon=Icon.FromHandle(bm.GetHicon());
	bm.Dispose();
	string filename2=Path.ChangeExtension(filename, ".ico");
	Stream stream=new FileStream(filename2, FileMode.Create);
	icon.Save(stream);
	log("Created icon "+filename2);
} catch(Exception exc) {
	log("Failed to create icon from "+filename);
	log(exc.ToString());
}

If all you need is a few different icons, run such code once and save the result as files or resources.

:) 

<div class="ForumSig">Luc Pattyn
<hr>I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
<hr>Local announcement (Antwerp region): Lange Wapper? Neen!
<hr></div>

Questionhow to cancel eventArgs Pin
Mr.Kode11-Oct-09 23:02
Mr.Kode11-Oct-09 23:02 
AnswerRe: how to cancel eventArgs Pin
stancrm11-Oct-09 23:41
stancrm11-Oct-09 23:41 
GeneralRe: how to cancel eventArgs Pin
freakyit11-Oct-09 23:49
freakyit11-Oct-09 23:49 
Question[Message Deleted] Pin
Swetha Srinivasan11-Oct-09 22:45
Swetha Srinivasan11-Oct-09 22:45 
AnswerRe: Title for the TableOfContents Pin
Md. Marufuzzaman11-Oct-09 23:23
professionalMd. Marufuzzaman11-Oct-09 23:23 
QuestionC# Attributes and methods Pin
manustone11-Oct-09 22:42
manustone11-Oct-09 22:42 
AnswerRe: C# Attributes and methods Pin
Simon P Stevens11-Oct-09 23:24
Simon P Stevens11-Oct-09 23:24 
AnswerRe: C# Attributes and methods Pin
Luc Pattyn12-Oct-09 0:08
sitebuilderLuc Pattyn12-Oct-09 0:08 
Question[Message Deleted] Pin
egpuyos11-Oct-09 22:04
egpuyos11-Oct-09 22:04 
AnswerRe: Dictionary Problem Pin
dan!sh 11-Oct-09 22:10
professional dan!sh 11-Oct-09 22:10 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:12
egpuyos11-Oct-09 22:12 
GeneralRe: Dictionary Problem Pin
N a v a n e e t h11-Oct-09 22:17
N a v a n e e t h11-Oct-09 22:17 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:28
egpuyos11-Oct-09 22:28 
GeneralRe: Dictionary Problem Pin
Luc Pattyn12-Oct-09 0:12
sitebuilderLuc Pattyn12-Oct-09 0:12 
GeneralRe: Dictionary Problem Pin
egpuyos11-Oct-09 22:14
egpuyos11-Oct-09 22:14 
GeneralRe: Dictionary Problem Pin
freakyit11-Oct-09 22:29
freakyit11-Oct-09 22:29 
Questionregarding auto generated mail in window application Pin
NarendraSinghJTV11-Oct-09 21:43
NarendraSinghJTV11-Oct-09 21:43 

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.