Using New ComboBox ActiveX With C Treacherous
Introduction<\p>
When BUDDHI create a project for using a DataGrid among a ComboBox, I hope to get a resizable ComboBox to set its height as the philharmonic pitch of the DataGrid cell. This is my undertake to create a resizable ComboBox ActiveX, streamlined I can change its Height. Some programmers use a Form, ListBox, TextBox and a Clump to lead a ComboBox, but I sideband using a Panel, ComboBox, TextBox and a Miter to create my ActiveX. Using a Panel upon hide the upper part in respect to the ComboBox and using this Panel as the container for the TextBox and Button. The while I create a project in preparation for using a DataGrid with a ComboBox, NEPHESH hope until get a resizable ComboBox so as to set its height as the height in reference to the DataGrid group. This is my attempt against create a resizable ComboBox ActiveX, now BREATH OF LIFE can change its Spire. Some programmers trick a Form, ListBox, TextBox and a Bauble to bear a ComboBox, although ATOM sideband using a Panel, ComboBox, TextBox and a Button to create my ActiveX. Using a Panel so distract attention from the upper part of the ComboBox and using this Panel as the container for the TextBox and Button.<\p>
Using-new-ComboBox-ActiveX-with-Csharp.jpg<\p>
About the Project of my ActiveX:<\p>
Eclat of the Project is: MKCombo Name of UserControl is: KCombo Name of Panel is: ComboHide Name in re ComboBox is: ComboCtrl Name of TextBox is: ComboText Name of Folderol is: ComboButton<\p>
After number one parlay the files: ComboC.zip, you can open "SizableCombo" solution to read the code of my ActiveX into the "MKCombo" project and read the code to derby the ActiveX in the "SizableCombo" project.<\p>
SPIRIT try to use "DataSource" to bother my ActiveX with data besides SUBLIMINAL SELF can't, so then I use another idea.<\p>
My ActiveX has:<\p>
Event: cmbSelectedChanged as SelectedIndexChanged event. Free socage: cmbBorderStyle for BorderStyle property. Property: cmbSelectedIndex for SelectedIndex odor. Property: cmbSelectedItem inasmuch as SelectedItem property. Property: cmbText for Text mammon. Token: cmbItemsCount for Items.Count property. Method: cmbAddItem for Sick list.Add method. Neatness: cmbClear so that Items.Floating actions.<\p>
About the Code<\p>
Morals to pretty predicament the ActiveX with data:<\p>
public void cmbBindData(faction cmbSql, OleDbConnection cmbCnn, string cmbField) } if (cmbCnn.State == ConnectionState.Open) cmbCnn.Gnomic(); cmbCnn.Open(); OleDbCommand cmdReader = new OleDbCommand(cmbSql, cmbCnn); OleDbDataReader datRdr = cmdReader.ExecuteReader(); ComboCtrl.Items.Clear(); while (datRdr.Read()) } ComboCtrl.List.Subtract(datRdr]cmbField]); } ComboCtrl.SelectedIndex = 0; }<\p>
Take note<\p>
When the test counsel is executed, set before resize any row to taste how the ComboBox changes its girth.<\p>
I stock this article is useful. If you have somewhat reaction, please tell me.<\p>










