Archived Months
November 2003
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
all groups > dotnet windows forms controls > may 2007

Filter by week: 1 2 3 4 5

MenuStrip...ToolStripItems
Posted by Herb at 5/30/2007 8:28:01 AM
How do I programatically access menu strip item subitems? I can get to top level menu items via MenuStrip.Items.Item(x), but how do I get to the .DropDownItems collection from there? Example: File <-- I can get to this MenuStrip.Items.Item(0) Exit <-- I can not get to th...more >>


Enable/Disable controls on a panel
Posted by Brian at 5/30/2007 8:14:01 AM
I have a panel with a bunch of controls on it. I want to be able to set the readonly property on the control ...but only the client area portion so that the scroll bars continue to work but none of the controls can be edited. Is there a way to get the client area control and set it's propertie...more >>

Dynamic properties for a PropertyGrid
Posted by David Thielen at 5/29/2007 3:10:01 PM
I added to PropertyBag the ability to pass an array of strings for an enum - http://www.davidthielen.info/programming/2007/05/passing_an_enum.html -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm ...more >>

Combo box with 2 data source
Posted by Abhishek at 5/29/2007 11:43:03 AM
Hi I want to have a combobox with some commands in it and a data source. Basically the list should look like command1 command2 ----------- data1 data2 data3 To solve this problem i decided to derive my own combo box form standard ComboBox control. I exposed 2 properties in this clas...more >>

Treeview with Checkboxes in root nodes only
Posted by Don at 5/28/2007 11:52:52 AM
Is it possible to set a Treeview control to show checkboxes on root nodes only? - Don...more >>

PropertyGrid - an object instead of a TypeConverter typeof()?
Posted by David Thielen at 5/26/2007 7:35:00 PM
Hi; I have a property grid where I need to pass it an object with N properties in it that are each an enumeration (but not an enum). These properties and they enumerated values are read from a database - so we don't know beforehand how many there will be and we do not know beforehand what t...more >>

ListBox crashes when accessing ListBox.SelectedIndex property
Posted by Valerie Hough at 5/26/2007 5:09:57 PM
Can anyone please tell me how it is possible to get the following crash when accessing ListBox.SelectedIndex property: Message: Index was outside the bounds of the array. Stack Trace: at System.Windows.Forms.ListBox.ItemArray.GetEntryObject( Int32 virtualIndex, Int32 stateMask) at System.W...more >>

Bug in designer when using custom controls "variable is either undeclared or was never assigned"
Posted by ~~~ .NET Ed ~~~ at 5/24/2007 5:34:11 PM
Setup: WinXP Pro SP2, Microsoft .NET 2.0, Visual C# Express Here is the problem. I have created a custom control that has a groupBox and within it it has a pictureBox, a listView and two buttons. This views ok in the designer and I was able to drop it as three different instances in the hos...more >>



Drawing Across Multiple Controls
Posted by HaySeed at 5/24/2007 12:14:05 PM
I want to resize a control at run time. To do this I want to draw a border rect of the object being sized starting on the MouseDown event and continuing until Mouse Up. The resizing border should "Float" over any other controls on the form. Question: How do I draw "Above" the form's coll...more >>

MenueStrip MouseHoover if Form has no focus
Posted by rfw68 at 5/24/2007 11:28:00 AM
Hello, I have a form with a MenueStrip in it. Well, as usual, if the user moves the mouse over one of the menue items, the background color automatically changes. If he now clicks on such a menue item, the menue drops down. So fare, so good. But, if the form does not have the focus, the ...more >>

Container Usercontrol paint problem
Posted by DC at 5/24/2007 10:38:01 AM
Hi all, Forgive me, although it seems crossposting it's not, just found this thread now. I'm in a hurry on this one. I've created a container usercontrol. Everything is fine, but I've 2 problems concerning painting issues: - In design time, when I drag other control, such as a button, e move i...more >>

Background color with the tab control
Posted by Chris at 5/23/2007 10:09:12 PM
The only place I found for setting background colors in the tab control is within each page. Doing that does not change background color of the TabPage where the Text is displayed. It just changes backcolor of the rectangular area below the captions. Is there a way to change the color of the...more >>

inheriting abstract usercontrol properties not hiding
Posted by t f at 5/23/2007 12:44:12 PM
hi i have a base abstract control,which defines a bunch of properties which are used in numerious controls which inherit the base abstract control. now i have done the following to a pile of properties in the base control [Browsable(false)] public override Color BackColor { get ...more >>

sorting after a rename of a listviewitem in a listview control
Posted by Michael.A.Kelley NO[at]SPAM gmail.com at 5/23/2007 11:32:47 AM
What's the best way to sort items in a listview after a rename of a listviewitem? Calling Sort() in the handler for the ListView.AfterLabelEdit event doesn't work (as the documentation points out), and there's no event as far as I can tell that I can register to that would allow me to sort afte...more >>

Show progressbar while connecting.....
Posted by Luc at 5/23/2007 6:35:00 AM
Dear, I've wrote a small application which attach a mdf file to a local SQL express server for reporting purposes. My question: while connecting the mdf file to server I want to show a progressbar to the user, since attaching a database is time consuming and takes 10 to 20 seconds. I've...more >>

VB.NET 2005 - Dragging window over app leaves "trails"
Posted by skinjob242 NO[at]SPAM yahoo.com at 5/21/2007 1:21:33 PM
Greetings all, I'm at a loss for fixing this problem, so I'm hoping someone out there has seen this and has a solution. Basically, I'm working on an app written in VB.NET 2005 which uses a mixture of native and custom controls. The app works fine and everything displays correctly until I dra...more >>

How do I tab out of my user control container?
Posted by Joseph Geretz at 5/21/2007 8:45:13 AM
I've developed a user control which is a container for other controls at design time. The problem I'm seeing at run time is that when the cursor is on the last contained control, pressing the Tab key doesn't send the cursor to the next control on the form, it simply beeps. How do I handle this...more >>

Preventing dialog boxes in a Webbrowser
Posted by JensB at 5/20/2007 1:05:44 PM
Hi I using VS2005 and Webbrowser loading it with some WORD AND Excel documents. Each time I navigate to a document, a Filedialog is showing up. I don't want any dialogs to show, and tried to stop them with this command: wbDoc.Application.DisplayAlerts = WdAlertLevel.wdAlertsNone WB.ActiveX...more >>

Can't tab past the last contained control on my container control
Posted by Joseph Geretz at 5/18/2007 4:13:04 PM
I've developed a custom panel control which is capable of hosting other controls. I'm using the following definition on my UserControl class to achieve this: (Visual Studio 2005 / Fx 2.0) [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design, Version=2.0.0.0, Cultur...more >>

Is a control visible in a form?
Posted by Caitlin at 5/18/2007 3:14:58 PM
There must be some way to do this in VB.NET which I'm simply overlooking; I'm sure of it. What I have: A label in a panel in a usercontrol (which is sometimes in a tab control) on a form. All of these are anchored top+left. What I want: To know if the label is visible at the form's curre...more >>

Expose User Control Property in VS Designer
Posted by JT at 5/18/2007 10:50:01 AM
Hi, Quick question - How does one annotate the property of a custom control so that it will show up at design time in the VS property designer window? Thanks -- John...more >>

AutoSizing a RichTextBox Control
Posted by JT at 5/18/2007 10:08:02 AM
Background: For a RichTextBox control, the RichTextBox.Multiline property affects whether or not the control will automatically resize, as follows: If RichTextBox.AutoSize is set to true and RichTextBox.Multiline is set to true, RichTextBox will not automatically resize. If RichTextBox....more >>

Control doesn't refresh after recompile
Posted by hoots at 5/14/2007 1:41:47 AM
I have a solution (VS 2005) with 2 projects, one contains User Controls, the other is a project which uses those controls. I have made some changes to a control and rebuilt it without any problems but those changes don't get reflected in the application project. I've even tried deleting the c...more >>

Invalid Resx File error
Posted by Sugandh Jain at 5/14/2007 12:00:00 AM
Hi, This is a strange problem we face sometimes in our windows based application project. the solution contains several projects and different developers work on different parts. all the parts are dependent on some/all other parts. We are using VS .Net 2005. The problem is sometimes i...more >>

Bound combobox selects invalid value
Posted by Andrus at 5/13/2007 4:08:26 PM
To reproduce: 1. select upper 2. press Tab Observed: combobox contains lower Expected: should contain upper How to fix ? Andrus. using System.Windows.Forms; using System.Data; class testForm : Form { ComboBox comboBox1; testForm() { DataTable t = new DataTable(...more >>

know of a transposed datagridview or similar?
Posted by RipT at 5/12/2007 2:33:00 PM
I need to be able to display 1-10 short name/value pairs. The number of pairs should be dynamic and the names and values should be editable. With a DataGridView, I waste a LOT of screen real estate: Name Value dirt brown milk white blood red grass green If I cou...more >>

Replacing Scrollbars
Posted by Peter Larsen [] at 5/10/2007 2:44:41 PM
Hi, I am trying to figure out how to replace the scrollbars in a scrollable control like a tree control or a list control with my own custom scrollbar control. I have read many articles about this subject - e.g. in codeproject and similar places - and they all have some good ideas about ho...more >>

TreeNode as a web link
Posted by Ras at 5/9/2007 9:08:39 PM
Hello, Is there an easy way of making tree node elements to behave the same way web links would? Thanks, Rob ...more >>

DataGridView CurrentCell.ReadOnly Property
Posted by tim8w via DotNetMonster.com at 5/9/2007 1:50:35 PM
I have a ReadOnly DataGridView where I would like to set the CurrentCell to allow editing. I trapped CellContentClick and attempted to set the ReadyOnly to 'False'. As I step through the debugger, I notice that it doesn't get set to 'False'. Any ideas? Code: MyDataGridview.CurrentCell.ReadO...more >>

retrieving selected items from listbox
Posted by SONET at 5/9/2007 8:40:01 AM
i am trying to retrieve multiple selected items from a listbox, but i am confused as to how this is done. -- ListBox.SelectedIndexCollection selection = lstbox.SelectedItems; string msg_name; for(int i = 0; i < selection.Count; i++) { msg_name = selection.Item??? } In the document...more >>

Printing Mschart in VB.NET 2005
Posted by Plasticpeer at 5/8/2007 2:06:00 AM
When trying to print MSChart in VB.Net 2005 the system fails, this is a known issue. I have searched the net for solutions, but the ones I have found has other problems. Does any one have a workaround where I still can use Editcopy and paste from the clipboard? Thanks Peer ...more >>

DataGridViewComboBoxColumn use ENTER key as TAB key
Posted by christoph.burgdorf NO[at]SPAM bvsn.org at 5/8/2007 1:40:21 AM
Hi, Im using a datagridview which reacts on the enter key as on the tab key. In other words, it moves to the next column instead of moving to the next row. This works great for normal DataGridViewTextBoxCells. I use derived classes from DataGridViewTextBoxCell, DataGridViewTextBoxColumn and D...more >>

DataGridView Column Header Alignment
Posted by David McCallum at 5/8/2007 12:00:00 AM
I have the code below to return a DtaGridViewColumn, the cells themselves are aligned right, but the column headers always seem to appear centered. Have I missed something? TIA David McCallum private DataGridViewColumn buildColumn(string propertyName, string colHeader, int colWidth) ...more >>

CheckedListBox Control
Posted by Sugandh Jain at 5/7/2007 8:22:49 PM
Hi, is their any property in this control, in .Net 2.0 which checks all the items as they are added to the list box. the list in this box changes based on the selection in a combo-box above. the requirement is such that we have to show all the items selected inittailly as the value selected...more >>

Adding rows dynamically in a DataGridView
Posted by Subrahmanyam at 5/7/2007 9:11:00 AM
Hi Friends, I have a requirement for the DataGridView of Windows Forms and is expalined as follows: 1. I have a Quantity textbox in the DataGridView. 2. When the user enter the quantity > 1 (say 3), a total of 3 rows should be added including the current row with the row quantity in all...more >>

What control to use???
Posted by Brian Simmons at 5/5/2007 12:05:43 PM
Hi All, I'm rewriting some of my Delphi application into C#/.NET2 winform applications. In my Delphi application, I utilized a 3rd party component which could display an HTML document (I built the string on the fly and loaded). The component had pretty decent HTML support (enough for my...more >>

Maximize/Restore Form
Posted by David McCallum at 5/5/2007 11:47:02 AM
How do I tell if a form has been maximized or restored? I thought the ResizeEnd event would have handled it. TIA David McCallum ...more >>

Different window size between framework 2.0 and 3.0
Posted by Massimo at 5/4/2007 9:26:18 PM
I have an application where the main window's size is defined at runtime, based on an image which is displayed inside it. The application contains a (subclass of) PictureBox which displays the image; the size of the PictureBox is set to the image's size; the PictureBox is then placed inside...more >>

third party tabcontrol recommendations ?
Posted by Bill Woodruff at 5/4/2007 9:15:38 PM
Hi, I've been using the VS 2005 tabControl and am pretty disgusted with its performance, the way that sometimes text on the tab page labels is not properly drawn (or clipped ?). Anyone have a good experience with a 3rd. party control that's a "step-up" from the many free examples on Code...more >>

Create Image Object from byte[] readed from DataBase.
Posted by Alvaro E. Gonzalez V. at 5/4/2007 4:34:44 PM
Hi; I work on Framework 2.x using C# language, have this problem for to resolve: I know how read a image file stored in data base loading this in byte[]. I don't know how 1. Convert this byte[] to XML format as image ( similar resx file ). 2. Convert this XML to image object. Thanks ...more >>

ImageList Member Missing from ToolStrip
Posted by Paul Engel at 5/4/2007 2:14:30 PM
I have added an ImageList to my VS2005 startup form. I have also added a toolstrip. The documentation suggests that there should be an ImageList property in the properties box that I can set to my ImageList object. It is not on my list. Any idea why this member would not be there? Side issu...more >>

Restricting user input to a certain character set
Posted by Tamer Ibrahim at 5/3/2007 1:40:08 PM
Hi, I have a text box that I want to prevent the user to input any latin character. So that, the user can only input arabic characters ..... I hope I made myself clear enough. Thank you. Tamer ...more >>

tables do not display correctly in RichTextBox
Posted by dgcooper at 5/3/2007 7:01:01 AM
When I load rtf files using both the LoadFile() method and RTF property, the tables in the files are not displaying correctly. They do show up correctly in Word and Wordpad. This there a known issue with tables in an RTF file? Please help. ...more >>

Setting selection rectangle width of ListView Items to client width
Posted by Tristan at 5/3/2007 4:23:03 AM
Hi, When an item is selected in a ListBox the width of the dark blue selection rectangle is the width of the entire listbox. This is not the case for a ListView with the View property set to 'List' and FullRowSelect set to True or False. Is there any possible way, even if it involves sendin...more >>

Property Grid
Posted by mecspek at 5/2/2007 11:50:46 PM
Hello, I am just figuring out if there is a way to enable the Horizontal Scroll bar for a property Grid. By default, the control shows the vertical scroll bar. PropertyGrid derives from ScrollableControl which has SetScrollState method, but using this nothing happens. Thanks in advance, ...more >>

How to programmatically update a cell after user editing another cell in Datagrid windform?
Posted by Patriot at 5/2/2007 6:04:56 PM
Hello, I'm trying to update column UpdatedBy with the userID (of the person who runs the program) in my datagrid when a cell in the datagrid is edited. How can I do this? Thanks ...more >>

updating DataTable in DataGrid
Posted by Jerry N at 5/2/2007 11:58:04 AM
I am working on a winforms application (using VS.NET 2003) and need to re-bind/update a DataTable to a DataGrid (by creating a new one or changing the existing one). The DataGrid is on the main form and I need to update the DataTable when loading a new XML file. I get the following error m...more >>

Combobox with Resizable List (VS 2005)
Posted by jtokach at 5/2/2007 11:15:01 AM
Hi, Please tell me that Visual Studio 2005 includes an option to have the dropdown list in a combobox to be resizabe with the little handle in the bottom right corner of the list? I'm not hopeful as, ironically, several of the controls that were used to build the VS IDE aren't included i...more >>

Sortig DataGridView
Posted by David McCallum at 5/1/2007 12:00:00 AM
Maybe I'm mis-reading, but according to the documentation "By default, users can sort the data in a DataGridView control by clicking the header of a text box column. " I have a DataGridView with a BindingList as a Datasource. Clicking on the column headers has no effect Can anyone tell m...more >>


DevelopmentNow Blog