I have a custom combobox as below public class ListViewCombo : ComboBox { ToolStripControlHost listViewHost; ToolStripDropDown dropDown; public ListViewCombo() { ListView lstView = new ListView(); lstView.BorderStyle = BorderStyle.None; listViewHost = new ToolStripControlHost(lstView); dropDown = new ToolStripDropDown(); dropDown.Items.Add(listViewHost); } public ListView TListView { get { return listViewHost.Control as ListView; } } private void ShowDropDown() { if (dropDown != null) { listViewHost.Width = DropDownWidth; listViewHost.Height = DropDownHeight; dropDown.Show(this,new Point(this.Loation.X, this.Height),ToolStripDropDownDirection.BelowRight); } } private const int WM_USER = 0x0400, WM_REFLECT = WM_USER + 0x1C00, WM_COMMAND = 0x0111, CBN_DROPDOWN = 7; public static int HIWORD(int n) { return (n >> 16) & 0xffff; } …

Member Avatar
+0 forum 0

I have hosted my custom combobox (ComboBoxEx) on datagridview by following the steps in http://msdn.microsoft.com/en-us/library/7tas5c80.aspx. 1. I have created DataGridVIewComboExColumn derrived from DataGridViewColumn 2. Custom cell named "DataGridVIewComboExCell" is created from DataGridViewCell 3. Finally my custom edit control "ComboExEditCtrl" (derived from ComboBoxEx and implements IDataGridViewEditingControl) is created. 4. In ComboExEditCtrl, OnSelectedValueChanged method is overrided as below. protected override void OnSelectedValueChanged(EventArgs eventargs) { // Notify the DataGridView that the contents of the cell // have changed. valueChanged = true; this.EditingControlDataGridView.NotifyCurrentCellDirty(true); base.OnSelectedValueChanged(eventargs); } Whenever the grid is loaded, custom control (ComboExEditCtrl) displayed on the cell. The problem is when I change the …

Member Avatar
+0 forum 0

How to shrink the client area of a multiline textbox (Windows.Forms.Textbox) from the non-client area? That is I need to draw a focus line in-between verticalscrollbar and the text area of textbox (i.e line to be drawn inside textbox). So I need a space between the client area (typable area) and the scrollbar to draw the line. Any idea how to achieve this?

Member Avatar
Member Avatar
+0 forum 1

I have my own ListView class, inheriting from Forms.ListView. When double clicking on the column divider, the columns resize to show the column items in full size. However, for me this doesnt work properly - some words are partially hidden because I am using large font size to draw items. Now, when the column is double clicked, I want to calculate the column size by measuering the size of largest string in the column. Any one know how to find the largest string in the listview column **without iterating each item** in the listview?

Member Avatar
Member Avatar
+0 forum 9

I am using LIstView control in virtual mode with the property listView.VirtualMode=True and I have subscribed the event listView1_RetrieveVirtualItem(). But this event is being called many times for each item. What is the reason or How can I prevent RetrieveVirtualItem() from executing many times? Please check the below code. public class Form1 : Form { public Form1() { listView1.VirtualMode = true; listView1.VirtualListSize = 100000; listView1.RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem); } private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { ListViewItem itm=new ListViewItem(comboBOx.Items[e.ItemIndex].ToString()); e.Item = itm; // For each visibile item this code is executed many time. } }

Member Avatar
Member Avatar
+0 forum 1

I have skinned most controls in my winform application, except scrollbar in combobox. Any ideas?

Member Avatar
Member Avatar
+0 forum 4

In my project, I need a stand alone scroll bar for my text box. So I have created a customized scroll bar. Any idea How to use my customized scroll bar(both Horizontal and Vertical) in the text box instead of built-in scroll bar?

Member Avatar
Member Avatar
+0 forum 2

In my project, I have created around 12 custom controls(checkbox,radiobutton,editbox,progressbar,scrollbar,button etc...). Custom painting is done in all controls for the extended look and feel using Pen,Brushes,Graphics, GraphicPath,Images,Region and Bitmaps ect. After the use of these objects, I have disposed the objects using the Dispose() method. I am using these controls in a System.Windows Form. When I am contiously showing and closing the Form causes an increase in the GDI objecs each time. I have checked the GDI object count using Task Manager and confirmed the GDI leak in the form. My question is, how can I manage this GDI leak? …

Member Avatar
Member Avatar
+0 forum 3

Hi All, Is there any event to catch the column visibility change of datagridview? I am using a custom datagridview. I need to update the horizontal scrollbar maximum value whenever the column visibility is changed. Please provide some idea. Thank you.

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a custom combobox(say comboboxEX) derived from System.Windows.Forms.ComboBox. OnPaint() event I have some background color and styles for the combobox. Every thing works fine. My problem is, I can't set background color when DropDownStyle is "**DropDown**" and **Enabled = false**. But it workes when DropDownStyle is "DropDownList" and Enabled = false. How do I set background color for "DropDown" when it is in disabled state? Any help will be appreciated.

Member Avatar
Member Avatar
+0 forum 1

Hi all. I am new in C#. How can i use NETCONNECTINFOSTRUCT Structure.Wht r the related APIs. Can any one help me? Thanks in advance.........

Member Avatar
Member Avatar
+0 forum 3

Hi, all I am downloading a file using webclient class in C#. Can I calculate the downloading speed using any custom PerformanceCounter.Can any one help me. Thanks in advance..

Member Avatar
Member Avatar
+0 forum 2

hi all, How can i zip and unzip a file using SharpZipLib. I am wrking in C#. Can any one help me? Thanks in Advance

Member Avatar
Member Avatar
+0 forum 1

Hi All I want to catch an error and report it into a Database in a remote server.(C#.NET). Can anyone help me?. thanks in advance....

Member Avatar
Member Avatar
+0 forum 2

The End.