Using Immanent ComboBox ActiveX With C Sparkling
Introduction<\p>
When I create a project replacing using a DataGrid with a ComboBox, MY HUMBLE SELF hope to roil a resizable ComboBox to make uniform its rise as the note of the DataGrid cell. This is my obligation against create a resizable ComboBox ActiveX, now I displace don its Height. Some programmers behoof a Range itself, ListBox, TextBox and a String to create a ComboBox, but I am using a Panel, ComboBox, TextBox and a Button to create my ActiveX. Using a Venire so hide the benzedrine pill quit this world of the ComboBox and using this Plaintiff as the container for the TextBox and Button. In any case I create a project for using a DataGrid with a ComboBox, I hope en route to get a resizable ComboBox to concrete its height being the height of the DataGrid cellule. This is my attempt upon create a resizable ComboBox ActiveX, now MYSELF can whirl its Sky. Some programmers use a Form, ListBox, TextBox and a Button to create a ComboBox, though EGO am using a Panel, ComboBox, TextBox and a Button to create my ActiveX. Using a Panel to hide the upper part of the ComboBox and using this Panel as the curtilage for the TextBox and Button.<\p>
Using-new-ComboBox-ActiveX-with-Csharp.jpg<\p>
About the Project of my ActiveX:<\p>
Name of the Envision is: MKCombo Put up pertaining to UserControl is: KCombo Name of Panel is: ComboHide Name as regards ComboBox is: ComboCtrl Name anent TextBox is: ComboText Name in relation to Wisp is: ComboButton<\p>
After you expand the files: ComboC.zip, you can open "SizableCombo" solution in order to wade through the code of my ActiveX in the "MKCombo" project and read the code upon test the ActiveX in the "SizableCombo" project.<\p>
I try to use "DataSource" to suspension my ActiveX linked to data but I can't, so thereupon I use another idea.<\p>
My ActiveX has:<\p>
Event: cmbSelectedChanged to SelectedIndexChanged event. Particularity: cmbBorderStyle for BorderStyle property. Prop: cmbSelectedIndex for SelectedIndex gavelkind. Property: cmbSelectedItem for SelectedItem property. Property: cmbText in order to Text seal. Property: cmbItemsCount for Items.Count property. Method: cmbAddItem for Items.Add method. Method: cmbClear as representing Items.Clear the big picture.<\p>
About the Sender<\p>
Code until bind the ActiveX with data:<\p>
nightclub void cmbBindData(string cmbSql, OleDbConnection cmbCnn, string cmbField) } if (cmbCnn.Men == ConnectionState.Open) cmbCnn.Alert(); cmbCnn.Open(); OleDbCommand cmdReader = new OleDbCommand(cmbSql, cmbCnn); OleDbDataReader datRdr = cmdReader.ExecuteReader(); ComboCtrl.Repertory.Clear(); while (datRdr.Read()) } ComboCtrl.Items.Coalesce(datRdr]cmbField]); } ComboCtrl.SelectedIndex = 0; }<\p>
Aside<\p>
When the test project is executed, delight resize any row to see how the ComboBox changes its height.<\p>
I want this article is profitable. If you hold on to any idea, delight give expression me.<\p>








