Click here to Skip to main content
15,921,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing the look of a row of datagrid on mouseover Pin
Heath Stewart11-Jun-04 3:45
protectorHeath Stewart11-Jun-04 3:45 
GeneralXML Serialization & Deserialization Pin
khchan10-Jun-04 18:40
khchan10-Jun-04 18:40 
GeneralRe: XML Serialization & Deserialization Pin
Heath Stewart11-Jun-04 3:37
protectorHeath Stewart11-Jun-04 3:37 
Generaladding a Menu bar log Pin
samithas10-Jun-04 18:18
samithas10-Jun-04 18:18 
QuestionHow does ImageIndex property works Pin
luming112233445510-Jun-04 17:42
luming112233445510-Jun-04 17:42 
AnswerRe: How does ImageIndex property works Pin
Nick Seng10-Jun-04 21:30
Nick Seng10-Jun-04 21:30 
GeneralRe: How does ImageIndex property works Pin
Heath Stewart11-Jun-04 3:30
protectorHeath Stewart11-Jun-04 3:30 
AnswerRe: How does ImageIndex property works Pin
Heath Stewart11-Jun-04 3:29
protectorHeath Stewart11-Jun-04 3:29 
You should look into the System.ComponentModel namespace, specifically the EditorAttribute and UITypeEditor classes.

There are some already created for you, but you need to follow certain guidelines. For starters, the class in which you would define an ImageIndex property must have a Parent property that references a Control with an ImageList property type (the property name doesn't matter). Then attribute your ImageIndex property like so:
[Editor("System.Windows.Forms.Design.ImageIndexEditor, System.Design", typeof(UITypeEditor)]
public int ImageIndex
{
  get { return imageIndex; }
  set { imageIndex = value; }
}
Here, imageIndex is a private field declared in your class to hold the value. Depending on how your component works, you may need to update the parent control.

If you don't follow these guidelines, you'll need to create your own UITypeEditor derivative.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: How does ImageIndex property works Pin
luming112233445513-Jun-04 16:17
luming112233445513-Jun-04 16:17 
GeneralRe: How does ImageIndex property works Pin
Heath Stewart13-Jun-04 17:52
protectorHeath Stewart13-Jun-04 17:52 
Generalincremental installation of C# application Pin
ting66810-Jun-04 15:52
ting66810-Jun-04 15:52 
GeneralRe: incremental installation of C# application Pin
Peter Vertes10-Jun-04 17:52
Peter Vertes10-Jun-04 17:52 
GeneralRe: incremental installation of C# application Pin
Anonymous11-Jun-04 19:00
Anonymous11-Jun-04 19:00 
GeneralProblem using embedded WMP to play file in C# Pin
Admiral Ackbar10-Jun-04 15:43
Admiral Ackbar10-Jun-04 15:43 
GeneralRe: Problem using embedded WMP to play file in C# Pin
User 96257810-Jun-04 17:21
User 96257810-Jun-04 17:21 
GeneralRe: Problem using embedded WMP to play file in C# Pin
Admiral Ackbar11-Jun-04 2:33
Admiral Ackbar11-Jun-04 2:33 
GeneralAlso..... Pin
User 96257812-Jun-04 7:17
User 96257812-Jun-04 7:17 
GeneralRe: Also..... Pin
Admiral Ackbar12-Jun-04 11:30
Admiral Ackbar12-Jun-04 11:30 
GeneralRe: Also..... Pin
User 96257812-Jun-04 17:08
User 96257812-Jun-04 17:08 
GeneralWindows Services - Config App Pin
AndyBewley10-Jun-04 12:41
sussAndyBewley10-Jun-04 12:41 
GeneralRe: Windows Services - Config App Pin
Xiangyang Liu 刘向阳10-Jun-04 14:36
Xiangyang Liu 刘向阳10-Jun-04 14:36 
Generalhelp in dll Pin
SherKar10-Jun-04 11:57
SherKar10-Jun-04 11:57 
GeneralRe: help in dll Pin
Colin Angus Mackay10-Jun-04 12:20
Colin Angus Mackay10-Jun-04 12:20 
GeneralUser Controls Pin
Flack10-Jun-04 11:18
Flack10-Jun-04 11:18 
GeneralRe: User Controls Pin
Heath Stewart11-Jun-04 3:20
protectorHeath Stewart11-Jun-04 3:20 

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.