winforms

TextBox TextChanged event does not fire when Visible = False?

I have a textbox bound to a datasource. The textbox's TextChanged event updates another textbox. The problem is, I do not want the first textbox to show, so I set its Visible property to false. However, now the TextChanged event does not fire! I can work around it by setting Visible=True, Left=-100000 on form load, but I'd like a pro...

Winforms application with no main form - dialog not shown on top

I have a winforms application that doesn't really have a main form - it's just a simple file handling tool so it doesn't really need one. When the application starts, first an OpenFileDialog is used to select a file. Then, a dialog box is shown using Showdialog() with some options for how the selected file should be processed. Finally...

How to fill a list view with the contents of Dictonary<string,List<String>> in C#

I've a Dictionary Dictionary<string, List<string>> SampleDict = new Dictionary<string, List<string>>(); I need to fill a listView with the contents of the Dictionary For example the "SampleDict" contains One A B C Two D E F The listView should be filled like S.No Item SubItem ...

C# how do I pause my program and wait for keyboard input from within a WinForm

I have a C# 2008 Winform application and I'm in the middle of a loop. I'm displaying a date to the user and I want them to tell me the day of the week that this date falls on. For example 6/22/2010 is displayed and the user needs to press t. What I'm stuck on is how do I pause my application and wait for keyboard input? I want to respo...

Visual Studio - Menu items and toolbar buttons missing after deleting a resource.

Something very strange happened here in Visual Studio 2008 (C#). After deleting an icon resource from my project all my menu items and toolbar buttons disappeared. I checked my form Designer.cs file and the code to the items are still there. Also, I tried to search for the deleted resource file name (warning.ico) in the entire solution...

Cell Double Click event is not running. only Cellclick event gets executed.

hi folks, i have both the events cellclick and celldoubleclick for a datagridview in my window forms application. The problem is that when i double click , only the cellclick event triggers, as it cannot detemine if its single click or double click. i searched for this and found that timers could be the solution..but how to do that ? ...

View images in folder

I am building a windows form in C#. Along the bottom of my form, I would like to have a horizontal row of image thumbnails for all the images in the folder. Ideally, the user could double-click an image and it would open up in the default picture viewer. Any and all help is appreciated! ...

Loading Images in Windows Forms

Hi, Currently I am loading Images stored on a network shared drive as Image byte array and loading using the Image byte array. This takes quite some time to load. Is there any other better way to load images which are stored on another machine in the network? ...

ContextMenuStrip not highlighting Items according to mouse movement

I have a ContextMenuStrip that I am showing programmatically in response to a button being clicked. Everything works as expected, except that the Items in the menu do not respond to being moused over. Whether the mouse button is up or down, mousing over the menu has no visible effect, and releasing the mouse button does not select an I...

Issues with ListView & File Output

I have so many issues with my project, i really don't know where to begin. First off, i get an error "an object reference is required for non-static field, method or property". It underlines retPath (the line: DriveRecursion_results.DriveRecursion(retPath);). I have no idea how to fix this. THe other thing i'm still stumped on is how...

Adding Items To A ListView Through A WinForm?

If I have a ListView embedded in a WinForm, is there any way I can simply click in the ListView and start typing in new items when the form is running? ...

How to add an image to ListViewItem or ListView c#

I have a listview control, to this control I am adding rows which contain image data, filename, position (its taken at a point in a 4 dimensional matrix), time taken. To make things nice I want to add a 'delete' icon to my fourth column so the user can review the image and decide whether to keep it or not, how do I add an image/icon to ...

C# on program close

I have a project that requires that I run some code when the application closes. The application is only a single form that hides itself almost immediately after execution, so the only way it can be closed is by manually terminating it with the task manager. If I use the onclose event, will it be called in this case? Also, can someone p...

c# winforms ListView columns min width

I have several list view controls, each with many columns that I'd like to have the columns can't be resized too small passed the label size. I know I can handle the event for colun width changed but I don't want to have to do this over and over again, and all columns are different length of text. ...

Right justified combobox in C#

Hello By default the items in the C# Combobox are left aligned. Are there any options available to change this justification apart from overriding DrawItem method and setting the combobox drawmode --> DrawMode.OwnerDrawFixed? Cheers ...

Windows Form App as Scheduled Task

I have run into a case where a Windows Form application is being run regularly via a scheduled task on a Windows Server 2003 box. The GUI is, obviously, not being used to take in any user input, so it is at best pointless. But is it also dangerous? Could it cause anything to go pop on the box? ...

Move a window on keypress + mouse (like linux ALT + mouse down)

Simple, i want to move a windows pressing ALT+MOUSE, like linux os (ALT+drag). It's possible to pass a win32 api (move api) to the windows interested clicking on it? I have a windows services that hook key pressed (ALT button in specific). When ALT key is pressed and a mouse down event is verified, i want to move window clicking anywhe...

C# Dropdown Slide Form

Is there any built-in control like a dropdown/slider? For instance, I want to display some info on dialog/control/form and inside that form there is a arrow which expands it to show more information? When I click the black arrow, the form should expand vertically to show more info. That's what I want to achieve. If there isn't any bui...

Override explicitly implemented interface method in derived class

I want to explicitly implement an interface method on a base class. Beyond this, I wanted to make this method virtual so I could override it on a derived class, but explicitly implemented methods do not allow this. I have tried making a protected virtual method in the base, calling this from the interface method, and then overriding th...

How to change the dropdown value based on string value in .net winforms

i am using .net winform. based on my string it will focus the drop down value. ex. my dropdown have select value ..if i pass select as a value it should focus the select option in dropdown . ...