예제 #1
0
 public void ApplyStyles(Control parent)
 {
     if (parent is IControlStyle)
     {
         ControlStyleHelper.SetStyle((IControlStyle)parent);
     }
     if (parent.Controls.Count > 0)
     {
         foreach (Control ctrl in parent.Controls)
         {
             ApplyStyles(ctrl);
         }
     }
 }
예제 #2
0
 private void InitStyleNameList()
 {
     if (this.Items.Count == 0)
     {
         this.IntegralHeight = true;
         this.DataSource     = null;
         string[] styles = ControlStyleHelper.GetStyleNames();
         foreach (string style in styles)
         {
             this.Items.Add(style);
         }
         int height = this.GetItemHeight(0);
         this.Height = height * 20;
     }
     if (this.Value != null && Value is string)
     {
         this.SelectedIndex = this.FindString(this.Value.ToString());
     }
 }