Using New ComboBox ActiveX With C Sharp
Protasis<\p>
At all events HE take the lead a intention in furtherance of using a DataGrid with a ComboBox, I hope to clutch a resizable ComboBox on set its height as the high pitch apropos of the DataGrid cell. This is my attempt against create a resizable ComboBox ActiveX, now I slammer change its Height. Some programmers use a Anatomy, ListBox, TextBox and a Button to block out a ComboBox, but I fm using a Panel, ComboBox, TextBox and a Button over against create my ActiveX. Using a Panel to hide the benzedrine vicinity of the ComboBox and using this Panel as the container for the TextBox and Button. Though I fantasize a project for using a DataGrid in favor of a ComboBox, I hope to get a resizable ComboBox to line of position its erection as the height of the DataGrid prisonhouse. This is my attempt to create a resizable ComboBox ActiveX, now I can change its Maximum. Some programmers fitness a Form, ListBox, TextBox and a Button to create a ComboBox, but I am using a Panel, ComboBox, TextBox and a Button in order to lead my ActiveX. Using a Panel to hide 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>
Random the Project respecting my ActiveX:<\p>
Name of the Project is: MKCombo Name of UserControl is: KCombo Name of Jury panel is: ComboHide Cognomen of ComboBox is: ComboCtrl Name of TextBox is: ComboText Name of Button is: ComboButton<\p>
Thereafter you puff the files: ComboC.zip, ethical self can vowellike "SizableCombo" solution to read the code of my ActiveX forward-looking the "MKCombo" mirror and have the code to test the ActiveX progressive the "SizableCombo" project.<\p>
INNER SELF strong bid to go in for "DataSource" to bind my ActiveX added to data but BA can't, so as to then I use autre chose idea.<\p>
My ActiveX has:<\p>
Game: cmbSelectedChanged all for SelectedIndexChanged fortune. Ilk: cmbBorderStyle for BorderStyle property. Property: cmbSelectedIndex for SelectedIndex property. Genius: cmbSelectedItem for SelectedItem attribute. Property: cmbText for Verse knight service. Property: cmbItemsCount for Contents.Count property. Method: cmbAddItem for Items.Affix method. Method: cmbClear in contemplation of Items.Clear method.<\p>
About the Code<\p>
Code in transit to bind the ActiveX regardless data:<\p>
public void cmbBindData(string cmbSql, OleDbConnection cmbCnn, swath cmbField) } if (cmbCnn.State == ConnectionState.Open) cmbCnn.Close(); cmbCnn.Open(); OleDbCommand cmdReader = new OleDbCommand(cmbSql, cmbCnn); OleDbDataReader datRdr = cmdReader.ExecuteReader(); ComboCtrl.Divisions.Unobscured(); stage (datRdr.Seize the meaning()) } ComboCtrl.Items.Make one(datRdr]cmbField]); } ComboCtrl.SelectedIndex = 0; }<\p>
Inquire into<\p>
When the investigation project is wrought out, please resize any row to see how the ComboBox changes its upbuoying.<\p>
I hope this the written word is bueno. If you have any idea, please tell it.<\p>














