I have a windows forms application (.NET C# 3.5)... that is throwing an error.. but I have 2 scenarios:
Client: on the client side.. the error is logged into a log.txt file.. AND an error pop up message appears
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
***** Ex...
I understand it is best practise to call Dispose() on instances of Pen and Brush, except if they've been set to the system-predefined values (eg. System.Drawing.Brushes, System.Drawing.Pens or System.Drawing.SystemBrushes)
Trying to dispose a system-defined resource results in an exception being thrown.
It doesn't appear to be obvious...
I create a combobox in a class and want to set the selected value for that combobox. But when I do that, the selectedValue stays null and when I try to set the selectedIndex I get a ArgumentOutOfRangeException.
Code:
public Control GenerateList(Question question)
{
// Clear the local givenAnswer collection
_givenAnswer.Clear()...
How do i return a non-zero exit code from a Windows Forms application.
Application.Exit() is the preferred way to exit the application, but there is no exit code argument.
I know about Environment.Exit(), but that is not a nice way to close the application loop....
...
I need the DataGridView to update the cell contents OnPropertyChanged, rather to OnValidate.
The DataGridView is bound to a BindingSource, sourced by a subclass of BindingList with custom business objects.
The DataGridView is for selecting the desired object, that is then bound to common controls on the form, so the user can edit it. I...
When I change the datasource of my Listbox all items are cleared, when loading new data into this Listbox it stays clear.
I have another ListBox right new to this one with the same refresh code but that one refreshes perfectly.
private void RefreshContacts()
{
this.ListContacts.DataSource = null;
this.ListContac...
I have an application where in the end user can change the color of the form, textboxes, labels, buttons during run time. Let us say that if a form is opened and the user has changed the form color from blue to green. To affect the color settings the existing form has to be closed and re-opened as I'm setting the form color in the Form_L...
When I select an item on my Listbox, a Textbox is filled with the selected text for editing. How can I get the cursor to focus on the Textbox text so I don't have to click on it with my mouse before editing?
...
I have a winforms application that includes an Administration form (call it 'adminForm') and another form (call it 'userForm') that is on a timer that opens and runs it on a set time interval.
How do I prevent the userForm from opening when the adminForm is open?
Until recently the userFrom was prevented from opening by using the 'Main...
I'm trying to override click events on NotifyIcons in .NET.
The problem is the class is sealed and cannot be inherited. The functionality I'd like to attain is rather than using a context menu to control the application, I'd like to doubleclick the icon to toggle the applications mode.
Is this possible?
...
Hi,
I'm using NHibernate 2 with WinFoms.
I try to use a Combobox as a Lookup - Combobox. I bind it the normal way. But it doesn't work (error:invalid value). What can I do?
...
I have an application that replaces a physical function keyboard with keys on the screen. Example of existing application
Now I locate all the buttons in the window with code and it is rather slow. So I wonder if I can solve this with WPF. Unfortunately, I am new to WPF and wondering how I should proceed.
Requirements
Location of th...
In my application I disable the Start menu using 'LowLevelKeyboardProc'. But i get the following error when i pressing the tab key continuously.
The Error..
Unhandled exception at 0x00352d58 in
Timer_soosai.exe: 0xC0000005: Access
violation reading location 0x0000000c.
00352D58 mov eax,dword ptr [ecx+0Ch] /*This is th...
I'm trying to integrate a WinForms Form inside a WPF XAML page.
I have seen examples of putting Windows Forms controls using WindowsFormsHost, but not for integrating a whole form.
Is there a way to do it? The Windows form is hosted inside the WPF application and I'm currently able to load it as a new window but not inside the XAML page...
A while back, I wrote my own settings provider because I was having problems persisting settings in a class library. (Note - I had no problems persisting settings from an application).
Today, I just did a test of persisting class library settings and it worked, without my custom provider.
The test is:
(1) Create a class library
(2) Add...
How to add controls in parent control
I am using C# windows application
I have a user control including group box and checkbox group box, controls gets enabled or disabled on the basis of checked property of check box
now when using this control in other application
how can i add controls in group box??
so that they can get enabled o ...
I am creating a user control where when a user clicks a button a popup window will show up with information. The popup window is driven by a toolStripDropDown so when it shows up it does 2 things
Does not move the other controls on the form around but displays over them
That it can show the details outside the bounds of the user cont...
I've been trying to use a button to extend the size of my form. However, for some reason, it won't let me do this. I'd think this would be an easy thing to accomplish, but I get the error:
"An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.Width.get'
The code I'm using that caus...
I have a combobox and I need the first row to be set as default.
This is my code
cbBrandForModel.DisplayMember = "BrandName";
cbBrandForModel.ValueMember = "BrandID";
cbBrandForModel.DataSource = dataTable;
I need to add this:
cbBrandForModel.DisplayMember = "Select Brand";
cbBrandForModel.ValueMember = "0";
Can anyone tell me...
I have a winforms application that uses a datagridview. When I access the EditedFormattedValue of a cell while it is in edit mode, sometimes, but not always, the whole cell turns black. Is this a feature of the datagridview, perhaps some sort of validation feature I need to turn off?
I have found a couple of other mentions of this pro...