Windows Forms General - Windows Forms
Recent update: 2008-3-21

VB.NET2003 - Items in ListBox are invisible

564 byte By MikeforVB at 2008-3-7
Probably a simple answer, but I just loaded VS.NET2003, and opened a sample applicaiton with 3 items in a preloaded in dropdown combo list box. when I click on the dropdown, the preloaded entries are invisible? when I click on one it displays in the selected box? I tried a simple list box with ...

Control program instance

357 byte By WongJunnKit at 2008-3-6
Dear seniors,How do I control instance for my program ? For example I only allow my program to have at most 5 instance in a pc, lets give it a name, abc.exe. I only allows my abc.exe to run 5 instance, but if some1's program called abc.exe too, they are not count as my program, and I do not ...

Keyboard shortcut for marking the whole text of a textbox?

163 byte By HenrikDahl at 2008-3-5
Hello! Isn't there a keyboard shortcut for marking the whole text of a textbox? I thought it was CTRL-A, but it seems it's not. Best regards, Henrik Dahl

Adding Child Forms to User Settings

248 byte By BradRaulston at 2008-3-3
I'm trying to persist the child forms of an MDI app to the user settings and it doesn't appear to be possible, at least as far as I've found. Is there a way to do this in the desinger, or will it require a custom setting implementation? Brad

Icons not showing up on Treview

659 byte By KeithElder at 2008-3-1
I am using VS 2005 Beta and I have a Treeview UserControl that I built for a menu. I added an imageList to the control and added some icons that I want to associate with the control. When I build the solution and view the UserControl placed on a form in the designer, I can see the icons. ...

Merging MenuStrips

304 byte By WilliamW at 2008-2-28
How are you supposed to create merge menus using the MenuStrip control in VS2005 Beta 2? I can't successfully get MDI child forms merge with the MDI parent using the merge index, and I'm not sure if I'm just not doing it right or if it is a bug.Can someone please point me in the right ...

ContextMenuStrip Problems

817 byte By DarrenStones at 2008-2-27
Hello Everyone,VS BETA 2I have a MenuStrip with the standard items. I wish to create a contextmenu dynamically with the edit menu dropdown items in it. Obviously I don't wish to duplicate event handlers and of course I don't want to hard code the creation of the items.Why does the ...

When is the LostFocus event actually fired?

546 byte By HenrikDahl at 2008-2-26
Hello!In the documentation it reads "Occurs when the control loses focus". As far as I understand e.g. a TabPage's LostFocus event should fire when focus leaves the page, e.g. by putting focus at anoter page or outside the TabControl. I suppose I may explicitly assign focus at a control by ...

farsi label

1016 byte By villupuram at 2008-2-25
Hi guys, Iam trying to use a label control in my winforms. When I assign(thru the form designer) a farsi word or any arabic word it becomes reversed(xyz --> zyx). If I assign the value in run time it has no problem. The same problem exists in button control also. Some body please ...

TextFormatFlags.TabStop?

262 byte By MichaelWeinhardt at 2008-2-24
Hi Guys, What is the difference between TextFormatFlags.ExpandTabs and TextFormatFlags.TabStop? Or, rather, how do you set tab stops, or use TextFormatFlags and TextRenderer to provide the same tab stop behavior as StringFormat? Thanks, Michael Weinhardt

DatagridviewButtonColumn Text

394 byte By WeiWangfatheroftwins at 2008-2-23
How can I set text on the button all to "SELECT"?In beta1, I use DisplayTextAsFormattedValue = Falseto achive that, now beta2 doesn't have the property anymore.UseColumnTextForButtonValue ? if I use it, do I have to set every row of the button column to "SELECT"? that will be a pain. ...

ToolTip.Show Method

359 byte By Zaph0d at 2008-2-22
I want to display a balloontooltip on a textbox to display some info to the user about invalid input. I want the tooltip to popup immediately after I call my code and remain for a couple of seconds or until the user clicks the mouse/types etc.I am looking the show method, but it takes a ...

Problems testing refferences of labels in a control array.

1460 byte By CodeScribler at 2008-2-22
Hi All, I have a two dimentional array of type lable. I am using this array to create a grid (I eventualy gave up on the datagrid as it just wouldn't do the stuff I wanted without an auful lot of complex customisation). During the grids life time, rows will be added and removed. My problem is ...

cannot call value Close() while doing CreateHandle()

535 byte By JeDi at 2008-2-22
I am having a multithreaded application and I have certain views (collection of small windows) to be viewed in that. On one of the collection when I try to close the view, I get the exception caught:cannot call value Close() while doing CreateHandle() It seems that one thread was trying to refresh w...

New Window

265 byte By CyberOps at 2008-2-21
i am making a browser in vb 2005 beta but sometimes when i click a link it opens in a new window in Internet Explorer now how can i have it so it opens in a new version of my own browser or a browser on a second form ? any help would be greatly apreciated.

ToolStrip Color Picker

412 byte By Gravy at 2008-2-20
Hi there,before emarking on a jouney of discovery in custom drawing of ToolStrip items I have to ask the question:Is there a built in Font Color picker for the VS 2005 toolstrip? A font and font size combo are also needed!!I'm guessing there isn't one out of the box so can anyone point me in ...

WebBroser1.SelectedText

277 byte By WongJunnKit at 2008-2-20
hehe I know the line in subject wont work, but I want to have similar result, how do I know what user has highlighted in WebBrowser ? Beside that, can I disable 'some' WebBrowser features like do not load picture, do not run activeX, do not play sound, etc ? Thanks alot.

How to: Webbrowser NewWindow and Navigating equivalent to axWebbrowser

40504 byte By WilfridB at 2008-2-20
At first, I enjoyed the new webbrowser control but then I noticed that the args provided by the events NewWindow3 and BeforeNavigate of the axWebBrowser had not been implemented in the new control. Arg.Good news, the guys from Microsoft gave us the a workaround recently in C# and said they will ...

MaskedTextBox changes in Beta 2

77 byte By WeiWangfatheroftwins at 2008-2-19
Property InputText, OutPutText are gone. What are the replacements? Thanks

newbie needs help

581 byte By Netasia at 2008-2-18
Hi all, I'm a student who just begain to learn how to program with C#. My school project requires me to create a desktop window application to update a news section on a website.I'm using the Visual Studio 2005 Beta 2 C# Express. Can anyone kindly help me with the following? My server-side ...

Extending ComboBox

627 byte By A_S_G at 2008-2-17
Hi all,I have inherited the task of maintaining C# code that was developed on NT. I am currently trying to build and run it on XP. It is building fine but isn't running.The problem is down to a combobox. The developer has extended the standard ComboBox to add some functionality but it appears ...

calling GetThumbnailImage()

160 byte By Zaph0d at 2008-2-16
How do I use GetThumbnailImage()? What do I do with the Abort CallBack delegate? I am currently using null which seems to work, but is probably not a good idea.

Unhandled exception using webBrowser

826 byte By WilfriedMestdagh at 2008-2-15
Hi,I hade unhandled exception using WebBrowser and it is easy to emulate the problem. Just 2 form, and on Form2 a webbrowser component, this code on a button: private void button1_Click(object sender, EventArgs e) { Form2 F = new Form2(); F.ShowDialog(); } When program close unhandled ...

ToolStripContainer BackColor

316 byte By Gravy at 2008-2-15
Can anyone tell me what the background color of a ToolStripContainer should be? When I add a new one to my form it's property says Control color but it's not really. Changing the BackColor to say Red and the back to Control seems to correct the issue.Is this a known issue or is it by ...

OnMouseMove Invalidate Paint - uneven paint with multiple views

1328 byte By GregDude at 2008-2-15
My application has multiple views, typically four, and some may be hidden. When the user moves the mouse, I invalidate all the views so changes so changes will be shown in the next Paint event. The problem occurs when repainting takes a significant amount of time and the user continues moving ...

DateTimePicker Events don't fire

296 byte By ThomasM at 2008-2-15
VS 2005 Beta2: I like the DateTimePicker, but it seems the events don't fire, neither click, doubleclick, mouseclick, mousedoubleclick seem to fire. Are these events not yet implemented, does one need to click at a particular location or do I do anything else wrong? Thanks - Thomas

selected item in a list

830 byte By C#newbie at 2008-2-15
I'm trying to programmatically select item in a listbox in another program. I figured out the handle to the listbox but I'm having trouble selecting the items in the listbox. I have tried this so far and this doesnt seem to work. Can anyone help me out w/ whats wrong by fixing my code or ...

dragdrop between WinForms and Explorer

314 byte By joachim at 2008-2-15
I want to drag a file from my WinForms App (a treeview) to Windows Explorer. I need to allow copy AND move of files within my application, but a drop on the explorer should always only COPY it. Is there any way how I can change AllowedEffects to Copy when the user leaves my Application Window in a D...

how to move selected text on picturebox

251 byte By Saif Quadri at 2008-2-15
Im writing text on picture box in paint event using this code e.Graphics.DrawString(TextBox1.Text, Font, Brushes.Black, 0, 0); pictureBox1.Invalidate(); i need to move selected text "up/down/right/left" Any ideas? -TIA

TaskPane sample - designer not available

520 byte By Brian26 at 2008-2-14
Using Avalon-Indigo March CTP there are WinFX samples installed. Specifically I'm using the Framework\Technologies\WinForms\TaskPane C# example. It builds and runs fine. However when I try to view the designer for TaskPaneTest I get the following error: One or more errors encountered while ...

Again Winform Datagrid: Individual row height and Vertical Scrollbar

2349 byte By IndianOcean at 2008-2-14
Hi,We are using Windows.Forms.DataGrid control in our application.Let me explain what i have done so far so it will easy to understand the problem:We have used DataGridIconColumnStyle for one icon column and second is DataGridTextBoxColumn for some other purposeIn second column i am showing ...

ContextMenuStripe never closing

706 byte By Flap at 2008-2-13
I have non-modal Windows form hosted inside a native Win32 windows app. When the form opens a ContextMenuStrip the menu is displayed correctly but it never goes away unless I select one of the menu items, i.e. the menu doesn't automatically close when I click on any other window like it ...

How to: Webbrowser NewWindow and Navigating equivalent to axWebbrowser

40514 byte By WilfridB at 2008-2-13
At first, I enjoyed the new webbrowser control but then I noticed that the args provided by the events NewWindow3 and BeforeNavigate of the axWebBrowser had not been implemented in the new control. Arg.Good news, the guys from Microsoft gave us the a workaround recently in C# and said they will ...

Custom TreeNode

3184 byte By Phalanx at 2008-2-12
In a previous VS2003 application that I wrote I would add custom treenodes to the treeview on my form. When I do the same in VS2005 it does not allow me to add my custom node to the tree, giving the error:Overload resolution failed because no accessible 'Add' can be called with these ...

Problems with MonthCalendar

663 byte By jvervoorn at 2008-2-11
I have a MonthCalendar Control with CalendarDimension set to 3,1 so I get 3 months across. I set the SelectionRange to 4/13 so it will be 3 months, Prev, Current and Next. But this doesn't work. Where is the FirstMonth property so I can set it to month-1 it could be 0 if we don't care?I hope ...

global mouse hooks in .net

351 byte By G_Zola at 2008-2-10
Suppose a process notepad.exe has started. I like to know how to detect a period of inactivity of a user for that process, for instance how long the user has not entered anything into notepad.Maybe System.Diagnostics can solve this problem but i did not find much information on the ...

Cannot assign ImageList in Beta 2

453 byte By mo. at 2008-2-10
It appears that the Imagelist property is no longer available on the toolstrip. Yet, Image Key and Image Index are still available programmatically. Is there any way to assign Imagelist or has it been removed permanently from toolstrip? If the latter is the case, what is the recommended way to ...

Nullable types in PropertyGrid

1502 byte By AlanChurchill at 2008-2-8
How do you allow nullable types to display their values in propertygrids? For example: private MyEnum? test ;[DescriptionAttribute("Test"),CategoryAttribute("Options"),DefaultValueAttribute("")]public MyEnum? Enums{get { return test; }set { test = value; }} I then would like it attached to a ...

ComboBox / DataGridView Problem

601 byte By Fraadl at 2008-2-8
Hello, I have a form with a ComboBox and a DataGridView . One of the columns of the DataGridView is a ComboBoxColumn. The DataSource of the ComboBox and the DataGridView are Object BindingSources. If I assign a third Object BindingSource to the ComboBoxColumn and run the application, I get the ...

Obtaining images from Imagelists based on image name

766 byte By Debasish at 2008-2-7
Hi,I am designing a form in which there are some buttons created dynamically and each button has an image associated with it. The images are taken from an imagelist. During the application start up, the imagelist is loaded dynamically. My application needs to extract icons from the imagelist ...

Localization - Resource file links/sharing ?

390 byte By DevInstinct at 2008-2-7
Is it possible to use other resource files than the form localizable resource files to binds its properties, or to link some of its resource file entries to another resource file? The goal is to reuse and share common resource files for text labels among applications such as Windows Forms and ...

Still having problem

297 byte By ImranHaider at 2008-2-7
Dear All. I have a number sorting problem in datagrid. I have integer values (1,2,11) , when i click Datagrid Header to sort the data , the result shows like this : 1 11 2 This is because the it is sorting as string. Can anybody help me how to sort it as a number. Thanks

Getting user inactivity time in a process

351 byte By G_Zola at 2008-2-7
Suppose a process notepad.exe has started. I like to know how to detect a period of inactivity of a user for that process, for instance how long the user has not entered anything into notepad.Maybe System.Diagnostics can solve this problem but i did not find much information on the ...

Transparency in imagelist images

1168 byte By adamhearn at 2008-2-6
This has been a bugbear of .NET since V1.0 so I hope it has been addressed in .NET 2.0!Do the Windows Forms controls (ImageList and List/TreeView) now fully support images with multiple levels of transparency? In my instance I use PNG files with an alpha transparency but also have the option to ...

TabControl left or right -- text not visible

590 byte By ManniAT at 2008-2-6
Hi,I create a new WindowForms app and drag a tabcontrol on it.It has (by default) two pages.When I set the Alignment to left (or right) the Text disappears and the Multiline property is set to true.The text is visible if I use Button or Flatbutton but not with normal.The positive - in .NET 1.1 ...

Dropdown property for DataGridViewComboBox

219 byte By TAS at 2008-2-5
Hello! I'm looking for a dropdown property for a DataGridViewComboBox like it exists for comboboxes. I want to open the dropdown list by code and I'm used to set this property to "true". Regards, David

inherited control won't attach to form

729 byte By dennist at 2008-2-5
inherited control won't attach to form I inherited a bindingNavigator, added a CancelEdit button and some code, and built it successfully. I created a windows application, added a datasource, referenced the new control in the new app, and added it to the toolbox. I dragged the new control to ...

Image Gone on minimize? I'm using BitBlt

3297 byte By Teckniel at 2008-2-4
when i capture a part of the screen and minimize the program or put a program on top of itmy image is out of the picture boxis there samthing wrong with my code?Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As integer) As integerDeclare Function BitBlt Lib "gdi32" Alias "BitBlt" ...

Please read before posting

4990 byte By DavidM.Kean at 2008-2-4
This forum contains questions and discussions about Microsoft's .NET Windows Forms controls and features. These posts should contain programming questions only.If you have questions or problems regarding a specific piece of software or Windows itself, please use the Microsoft Newsgroups. Any ...

Forms docking

316 byte By MatthewCrockett at 2008-2-4
Does anyone know how to dock a form relative to the Screen? I am trying to have my help form imitate the help form that is used by Office applications so I need for the form to fill the right side of the screen and not allow itself to be resized or moved. Thank you for your time. Sincerely, ...