Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting numbers Pin
Le centriste28-Aug-07 7:04
Le centriste28-Aug-07 7:04 
GeneralRe: Converting numbers Pin
Scott Dorman28-Aug-07 7:10
professionalScott Dorman28-Aug-07 7:10 
GeneralRe: Converting numbers Pin
Le centriste28-Aug-07 7:14
Le centriste28-Aug-07 7:14 
GeneralRe: Converting numbers Pin
Scott Dorman28-Aug-07 7:23
professionalScott Dorman28-Aug-07 7:23 
GeneralRe: Converting numbers Pin
DavidNohejl29-Aug-07 1:01
DavidNohejl29-Aug-07 1:01 
QuestionIcons in ListBox Pin
spotl28-Aug-07 6:46
spotl28-Aug-07 6:46 
AnswerRe: Icons in ListBox Pin
Scott Dorman28-Aug-07 7:06
professionalScott Dorman28-Aug-07 7:06 
AnswerRe: Icons in ListBox Pin
I Believe In GOD28-Aug-07 7:20
I Believe In GOD28-Aug-07 7:20 
hi
here is my code

first My Listbox1 has a name panellist
second make sure to set PanelList.DrawMode = DrawMode.OwnerDrawVariable;
third fill the list with with 5 items

NOTE : this code is not full example it's just and right idea

		private void PanelList_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)<br />
		{<br />
			SolidBrush br = new SolidBrush(Color.Navy );<br />
			Image img = PicFavorites.Image;<br />
			StringFormat sf = new StringFormat();<br />
			sf.Alignment = StringAlignment.Far ;<br />
			sf.LineAlignment = StringAlignment.Center ;<br />
			e.DrawBackground();<br />
			br.Color = Color.Navy ;<br />
			e.Graphics.DrawString(PanelList.Items [e.Index].ToString () ,e.Font ,br,e.Bounds ,sf );<br />
			switch (e.Index )<br />
			{<br />
				case 1:<br />
				{<br />
					img = PicGeneral.Image;<br />
				}<br />
					break;<br />
				case 2:<br />
				{<br />
					img = PicEditView.Image;<br />
				}<br />
					break;<br />
				case 3:<br />
				{<br />
					img = PicIncomingCalls.Image;<br />
				}<br />
					break;<br />
				case 4:<br />
				{<br />
					img = PicServices.Image;<br />
				}<br />
					break;<br />
				case 5:<br />
				{<br />
					img = PicSetting.Image;<br />
				}<br />
					break;<br />
				default:<br />
					break;<br />
			}<br />
		e.Graphics.DrawImage (img ,e.Bounds.X + 10, e.Bounds.Y );<br />
		e.DrawFocusRectangle();<br />
<br />
		}<br />
<br />
		private void PanelList_MeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e)<br />
		{<br />
			e.ItemHeight = 48;<br />
		}


I know nothing , I know nothing

QuestionSet readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 6:26
Paw Jershauge28-Aug-07 6:26 
AnswerRe: Set readonly attribute of an class property at runtime Pin
J4amieC28-Aug-07 6:42
J4amieC28-Aug-07 6:42 
GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 10:12
Paw Jershauge28-Aug-07 10:12 
GeneralRe: Set readonly attribute of an class property at runtime Pin
led mike28-Aug-07 11:04
led mike28-Aug-07 11:04 
GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 20:27
Paw Jershauge28-Aug-07 20:27 
AnswerRe: Set readonly attribute of an class property at runtime Pin
led mike28-Aug-07 7:21
led mike28-Aug-07 7:21 
GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 10:15
Paw Jershauge28-Aug-07 10:15 
QuestionControl is locked, how to unlock? [modified] Pin
Jordanwb28-Aug-07 5:54
Jordanwb28-Aug-07 5:54 
AnswerRe: Control is locked, how to unlock? Pin
Guffa28-Aug-07 6:25
Guffa28-Aug-07 6:25 
GeneralRe: Control is locked, how to unlock? [modified] Pin
Jordanwb28-Aug-07 14:53
Jordanwb28-Aug-07 14:53 
GeneralRe: Control is locked, how to unlock? Pin
Guffa28-Aug-07 21:03
Guffa28-Aug-07 21:03 
GeneralRe: Control is locked, how to unlock? Pin
Jordanwb29-Aug-07 7:43
Jordanwb29-Aug-07 7:43 
AnswerRe: Control is locked, how to unlock? Pin
Guffa29-Aug-07 11:59
Guffa29-Aug-07 11:59 
QuestionRandom Number Pin
Imran Adam28-Aug-07 5:34
Imran Adam28-Aug-07 5:34 
AnswerRe: Random Number [modified] Pin
Alaric_28-Aug-07 6:05
professionalAlaric_28-Aug-07 6:05 
AnswerRe: Random Number Pin
originSH28-Aug-07 6:10
originSH28-Aug-07 6:10 
GeneralRe: Random Number Pin
Yitzchok Dev28-Aug-07 10:40
Yitzchok Dev28-Aug-07 10:40 

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.