Links

Faire un selecteur de valeur → par description (cb_bleu→0, cb_visa→1, cheque→2, etc)

DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox properties = cbStates.Properties;
properties.Items.BeginUpdate();
properties.Items.Add( new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Carte bleu", 0) );
properties.Items.Add( new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Carte visa", 1) );
properties.Items.Add( new DevExpress.XtraEditors.Controls.ImageComboBoxItem("Cheque", 2) );
properties.Items.EndUpdate();
cbStates.SelectedIndex = 0;
cbStates.Enabled = false;

How to use only one style controller for all the forms in a project?

Visual Studio does not allow you to assign objects from other forms to the properties of a control on a different form at design time. You can do this only at runtime. Thus, you should create a StyleController component on your main form and set its Modifiers to Public. Then, at runtime, you will need to iterate through all the components on a secondary form and assign the main form’s StyleController to the XtraEditors. Here is some sample code:

private void SetStyleController(Control parent, DevExpress.XtraEditors.StyleController styleController) 
{
   foreach(Control control in parent.Controls)
      if(control is DevExpress.XtraEditors.BaseEdit)
         ((DevExpress.XtraEditors.BaseEdit)control).StyleController = styleController;
      else
         SetStyleController(control, styleController);
}
 
SetStyleController(this, MainForm.StyleController);

I there a way I can set the PaintStyleName to Office2003 for all the grids I use in my application? I really would like a way to globally set the default to this style with one line of code in my application.

Yes, this is possible. You should put the DevExpress.LookAndFeel.DefaultLookAndFeel component onto the main form of your application and set its properties as shown below:

LookAndFeel.Style = Office2003 
LookAndFeel.UseWindowsXPTheme = False
 
  net_-_devexpress_winform_suite_tips_and_tricks.txt · Dernier changement: 2006/09/14 21:16