winforms

Equivalent of WinForms TextBox.Validating event in WPF

In WinForms I could handle the Validated event to do something after the user changed text in a TextBox. Unlike TextChanged, Validated didn't fire for every character change; it only fired when the user was done. Is there anything in WPF I can use to get the same result, an event raised only after the user is done changing the text? ...

how to disable keyboard for an activex control hosted in a winform ?

I'm working on an application embedding an activex component. This component has several keyboard shortcuts. Some of them are binded to actions which needs to be intercepted by my application before being run. For example, CTRL+S is binded to the "Save" action, and I have to perform some modifications to the document before the activex...

Can someone tell me how to create a "drag target line" in a winforms listbox that shows whether the drop source is being dropped before or after the drop target

Hello, I have a user control that is hosting a winforms listbox. I am re-sorting items in the list using drag and drop. I realized that I need a drag "target line" that shows whether I am dropping before or after a target. Any suggestions. I am open to suggestions. I am not wed to the listbox. I can use another winforms control (t...

How to implement the Display/ValueMember in my own control.

Hi, I created the custom winforms data control which has the "DisplayMember & ValueMember" properties (the functionality should be same as in standard winforms controls). But the problem is common and can be used in webforms. Now, I'm trying get values via Reflection and DataRow/DataRowView. Should be supported more ways how to get/set...

textbox properties

Hi, I have set the MaxLength property of a textbox in my windows forms application to 10 I am populating the textbox by reading from a file. However if a read string which is more than 10 characters the textbox still gets populated. But when I manually try to enter a string it works fine (that is, it does not allow more than 10 charact...

Why is Dispose being called?

In my application, I'm seeing that at times the Dispose method on my main form gets called for apparently no reason. I'm not closing the app through the UI, I'm not sending a close windows message or calling Close() anywhere, however the Dispose method still gets called. Here is the call stack: Bitter.Shell.exe!Bitter.Shell.MainForm.Dis...

Winforms hosting excel spreadsheet

Can I host an instance of excel application within a winforms application? Meaning, I want to use the excel as my datagrid in a winforms application. thank you for your input. ...

How to Highlight a specific word in WebBrowser control C#

I have a webbrowser control and I am able to get the selected word by the user. I am saving this word in a file and with it I am also saving its byte offset and length. Lets says i have some text in my Web browser control as "Hello Hey Hello" lets say the user has selected last hello. Now that word is saved with me along with other inf...

Breakpoint Affecting ProcessCmdKey Processing of keyData

Can anyone explain why the check for Alt+Left Arrow key is triggered on a Alt+Right Arrow key press within the ProcessCmdKey method? When I originally coded this method, everything worked. I am beginning to question all my key handlers, but wanted to know if there was a good explaination or if I am missing something. All other key combin...

A ComboBox Data Binding Question

I have an interesting data binding question related to combobox. Hope someone has some good suggestion. I have a simple form, it contains a file picker and a comboxbox. Every time a file is picked, I read a list of strings from the file to a List object and I set comboBox.DataSource = listOfStrings. In the form load event, I set comboB...

best c# open source tool for handling exceptions.

Can someone point me to a list of open source projects dedicated to exceptions handling ? Or to the best tool among them ? Update: I would like to use it with a n tier winform application. I would like to catch once and for all the 3 or 4 kind of exceptions that occur in my data access stack. Then pass them to the gui stack and show th...

displaying enumeration values in a DataGridComboBox problem

Hi. I have a dll that has a class called Series. This class has a field which is an enumeration of DataTypes. I am binding the datagrid to a list of objects of this class, and I am able to display the enumeration values in a combobox fashion However, the values' names don't make a lot of sense. For example, I want to display 'prc' as 'pr...

How can I get filename when user close Word?

I have one button and one textbox on form. When I click on the button, Microsoft Word is started. When the user closes Word, I want to get the file name that the user saved his work under to show up in the text box. I am using the following code for button_click: System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessS...

Button with an X at the upper-right corner of the form, how to catch this event @ C#

Which event is fired when I close a form with the X button? I want the event that fires only when the X button is pressed; I know that there is a FormClosing event, but the problem is that it fires each time when form is closed... It also fires when frm.close() executes, and I don't want that to happen. ...

Which directory does FileDialog uses?

Which directory does FileDialog (OpenFileDialog/SaveFileDialog) uses? When I show it from my application it opens folder which is not Environment.CurrentDirectory folder. How can I get this directory path? Or it's controlled by the OS and I can't know it? ...

Distribution of MDI children in an MDI parent

Hi all I have an MDI parent form that creates many MDI children at run time. Is there a smart way to evenly ditribute these forms inside there parent? any ideas? Thanks in advance!! ...

repaint Tab-Control empty Tab Space

In WinForms, how do I repaint the empty area that contains empty tab space to be filled by new tabs in a color of my choice? ...

C#, recursively notify child controls

I have my MainForm, it's a Windows Forms form. There are many child controls and now I want to call one function on my MainForm that notifies all children. Is there something to use in the Windows Forms form? I played with update, refresh and invalidate with no success. ...

Controller/Static State Class in WinForms Application - Where to put?

I'm writing a WinForms application and want to have an "MVC-Type" Design. Actually it's more MVP or MVVM,. The plan is to have a Central Controller which does all the actual work, so that the Forms just render out ViewModels and handle user input, but everything that actually does something goes through the Controller. I just wonder if...

DevExpress versus Telerik: Specific Feature Differences for WinForms Development

I'm interested in coming up with a list of specific feature differences between these two products. I'm specifically looking at DevExpress's DXperience Enterprise subscription and the Telerik Premium Collection for .NET, which seem to be closely competing offerings. If someone can point me at such a comparison list, that would be great...