Example #1
0
 private void GetControlsValue(Control.ControlCollection ctc)
 {
     foreach (Control control in ctc)
     {
         if (!control.HasChildren)
         {
             if (control is DevComponents.DotNetBar.Controls.TextBoxX && control.Visible == true)
             {
                 toolbar1.controlsValue.Add(control.Name, (control as DevComponents.DotNetBar.Controls.TextBoxX).Text);
             }
             if (control is DevComponents.DotNetBar.Controls.ComboBoxEx && control.Visible == true)
             {
                 DevComponents.DotNetBar.Controls.ComboBoxEx con = control as DevComponents.DotNetBar.Controls.ComboBoxEx;
                 toolbar1.controlsValue.Add(control.Name, con.Text != "" ? con.SelectedValue : "");
             }
             if (control is DevComponents.DotNetBar.Controls.CheckBoxX && control.Visible == true)
             {
                 toolbar1.controlsValue.Add(control.Name, (control as DevComponents.DotNetBar.Controls.CheckBoxX).Checked);
             }
             if (control is PictureBox && control.Visible == true)
             {
                 toolbar1.controlsValue.Add(control.Name, (control as PictureBox).ImageLocation);
             }
         }
         else
         {
             GetControlsValue(control.Controls);
         }
     }
 }
Example #2
0
 static void AsignaColorFondoComboBox(object sender)
 {
     DevComponents.DotNetBar.Controls.ComboBoxEx combo = (DevComponents.DotNetBar.Controls.ComboBoxEx)sender;
     //combo.DisabledBackColor = System.Drawing.Color.White;
     combo.DisabledForeColor = System.Drawing.Color.Black;
     return;
 }
Example #3
0
        public void llena_combo_estatico(String consulta, ComboBoxEx combo)
        {
            DataSet data_set = new DataSet();
            DataTable data_table;

            dame_dataset_de(consulta, data_set);
            data_table = data_set.Tables[0];
            combo.DataSource = data_table;
            combo.ValueMember = "VALUEMEMBER";
            combo.DisplayMember = "DISPLAYMEMBER";
        }
Example #4
0
		private void CreateComboBox()
		{
			if(m_ComboBox!=null)
			{
				m_ComboBox.Dispose();
				m_ComboBox=null;
			}
            m_ComboBox = new Controls.ComboBoxEx();
            m_ComboBox.IsStandalone = false;
            m_ComboBox.TabStop = false;
            m_ComboBox.TabIndex = 9999;
            m_ComboBox.Style = this.Style;
            m_ComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
            m_ComboBox.IntegralHeight = false;
            //m_ComboBox.ItemHeight = 13;
            m_ComboBox.ThemeAware = false;
            m_ComboBox.Visible = false;
            m_ComboBox.Text = this.Text;
            m_ComboBox.SelectionStart = 0;
            m_ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

            m_ComboBox.LostFocus += new EventHandler(this.ComboLostFocus);
            m_ComboBox.GotFocus += new EventHandler(this.ComboGotFocus);
            m_ComboBox.MouseHover += new EventHandler(this.ComboMouseHover);
            m_ComboBox.MouseEnter += new EventHandler(this.ComboMouseEnter);
            m_ComboBox.MouseLeave += new EventHandler(this.ComboMouseLeave);
            m_ComboBox.VisibleChanged += new EventHandler(ComboBoxVisibleChanged);
            m_ComboBox.DropDownChange += new Controls.ComboBoxEx.OnDropDownChangeEventHandler(this.ComboDropDownChange);
            m_ComboBox.TextChanged += new EventHandler(this.InternalComboTextChanged);
            m_ComboBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ComboKeyDown);
            m_ComboBox.SelectedIndexChanged += new System.EventHandler(this.ComboSelChanged);
            m_ComboBox.PreventEnterBeep = m_PreventEnterBeep;
            m_ComboBox.ParentItem = this;
			if(m_FontCombo)
				m_ComboBox.LoadFonts();

			if(this.ContainerControl!=null)
			{
				System.Windows.Forms.Control objCtrl=this.ContainerControl as System.Windows.Forms.Control;
				if(objCtrl!=null)
				{
					objCtrl.Controls.Add(m_ComboBox);
					m_ComboBox.Refresh();
				}
			}

			if(this.Displayed)
			{
				m_ComboBox.Visible=true;
			}
		}
 /// <summary>
 /// إضافة أي عنصر رث من واجه IaddName
 /// </summary>
 /// <param name="ComboBoxEx">عنصر المراد إضافة القائمه منه</param>
 /// <param name="Liststring"></param>
 public static void DataGridAddVuleComBoxEx <T>(DevComponents.DotNetBar.Controls.ComboBoxEx ComboBoxEx, List <T> Genric)
 {
     ComboBoxEx.Items.Clear();
     if (Genric.GetType().ToString() != "System.Collections.Generic.List`1[System.String]")
     {
         foreach (IaddName strin in Genric)
         {
             ComboBoxEx.Items.Add(strin.RetunNameString());
         }
     }
     else
     {
         for (int i = 0; i < Genric.Count; i++)
         {
             ComboBoxEx.Items.Add(Genric[i].ToString());
         }
     }
 }
        /// <summary>
        /// 傳入ComboBox,
        /// 檢查所輸入的文字,
        /// 是否為ItemList內的值,
        /// 當ComboBox Text為空時
        /// 視為資料正確
        /// </summary>
        static public bool ComboBoxValueInItemList(ComboBoxEx p)
        {
            bool b = false;

            if (!string.IsNullOrEmpty(p.Text.Trim()))
            {
                foreach (TeacherObj each in p.Items)
                {
                    if (each.TeacherFullName == p.Text.Trim())
                    {
                        b = true;
                        break;
                    }
                }
            }
            else
            {
                b = true;
            }

            return b;
        }