Click here to Skip to main content
15,887,965 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to write a number in a cell Pin
sikandarhayat20-Sep-06 2:15
sikandarhayat20-Sep-06 2:15 
GeneralRe: how to write a number in a cell Pin
albCode20-Sep-06 2:29
albCode20-Sep-06 2:29 
QuestionRe: how to write a number in a cell Pin
sikandarhayat20-Sep-06 2:44
sikandarhayat20-Sep-06 2:44 
AnswerRe: how to write a number in a cell Pin
albCode20-Sep-06 2:54
albCode20-Sep-06 2:54 
Questionhow can do bold some items of comboBox Pin
sikandarhayat20-Sep-06 0:50
sikandarhayat20-Sep-06 0:50 
AnswerRe: how can do bold some items of comboBox Pin
Christian Graus20-Sep-06 1:27
protectorChristian Graus20-Sep-06 1:27 
GeneralRe: how can do bold some items of comboBox Pin
sikandarhayat20-Sep-06 1:44
sikandarhayat20-Sep-06 1:44 
GeneralRe: how can do bold some items of comboBox Pin
J4amieC20-Sep-06 2:49
J4amieC20-Sep-06 2:49 
Its quite easy to make an Owner Drawn control. Basically, you are telling a control that you will write the code to draw each item in a control. In the case of a combo box, each item is an item in the drop-down portion.

To do it, follow these steps

1) Drag a combo box to your form

2) In the properties window change its DrawMode property to OwnerDrawnFixed

3) Change to the events and double click the DrawItem event

4) Switch to code view and you should have this

private void comboBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
}


5) Write your code in there, for example I used the following code to alternate bold and nomal items

private void comboBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
	if((e.Index%2)==0)
	{
		e.Graphics.DrawString(this.comboBox1.Items[e.Index].ToString(),e.Font,Brushes.Black,e.Bounds,StringFormat.GenericDefault);
	}
	else
	{
		Font boldFont = new Font(e.Font,FontStyle.Bold);
		e.Graphics.DrawString(this.comboBox1.Items[e.Index].ToString(),boldFont,Brushes.Black,e.Bounds,StringFormat.GenericDefault);
	}
}





Questioncan windows service start when the windows start ? Pin
abdallahziad20-Sep-06 0:47
abdallahziad20-Sep-06 0:47 
AnswerRe: can windows service start when the windows start ? Pin
Marek Grzenkowicz20-Sep-06 0:57
Marek Grzenkowicz20-Sep-06 0:57 
Generalalso i am asking about xml ?? Pin
abdallahziad20-Sep-06 1:08
abdallahziad20-Sep-06 1:08 
GeneralRe: also i am asking about xml ?? Pin
Colin Angus Mackay20-Sep-06 2:34
Colin Angus Mackay20-Sep-06 2:34 
GeneralRe: also i am asking about xml ?? Pin
abdallahziad20-Sep-06 2:39
abdallahziad20-Sep-06 2:39 
GeneralRe: also i am asking about xml ?? Pin
Marek Grzenkowicz20-Sep-06 3:07
Marek Grzenkowicz20-Sep-06 3:07 
GeneralRe: also i am asking about xml ?? Pin
abdallahziad20-Sep-06 3:18
abdallahziad20-Sep-06 3:18 
QuestionHow to display numbers in different formats like exponential Pin
deepualuru20-Sep-06 0:33
deepualuru20-Sep-06 0:33 
AnswerRe: How to display numbers in different formats like exponential Pin
Christian Graus20-Sep-06 0:42
protectorChristian Graus20-Sep-06 0:42 
QuestionORCA Pin
MHASSANF20-Sep-06 0:23
MHASSANF20-Sep-06 0:23 
AnswerRe: ORCA Pin
Christian Graus20-Sep-06 0:26
protectorChristian Graus20-Sep-06 0:26 
QuestionUsing C#, how to compare table data from 2 different databases Pin
JPD20-Sep-06 0:08
JPD20-Sep-06 0:08 
AnswerRe: Using C#, how to compare table data from 2 different databases Pin
Christian Graus20-Sep-06 0:29
protectorChristian Graus20-Sep-06 0:29 
QuestionC# and IBM WebSphere MQ message borwsing Pin
How Gee19-Sep-06 23:51
How Gee19-Sep-06 23:51 
AnswerRe: C# and IBM WebSphere MQ message borwsing Pin
Gavin Jerman20-Sep-06 1:39
Gavin Jerman20-Sep-06 1:39 
QuestionHow to add a seperator in windows context menu ? Pin
Waqas Nasir19-Sep-06 23:47
Waqas Nasir19-Sep-06 23:47 
Questiondoubt about onlayout Pin
kalaveer19-Sep-06 23:22
kalaveer19-Sep-06 23:22 

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.