winforms

CSharp DataGridView ComboBox Binding Issues

Hi Guys, I've got a CSharp program that I'm working on but I can't get the ComboBoxColumn to display as I want it to. I have two tables. One Contains a list of price. (Columns: PriceID, PartID, Price, MinimumQuantity, CustomerID, ExpiryDate) The other table, a list of parts contains (Columns: PartID, PartNumber). What I want to do i...

Select WinForm ListView Item, Press Delete: Trigger Code

Let's say I have a list item populated with a few items, I select one and press delete. I want something to happen when delete is pressed (and I'd like to know which item or items are selected). If this is possible, I'd like to know how to do this. Thanks! ...

How do I override ProcessMnemonic()?

One of my forms requires special handling for two of its mnemonics which are attached to one control ("In" and "Out" UltraLabels with an UltraTrackBar in between). One possible solution is to override ProcessMnemonic() in a manner like so: (I can only include pseudocode) // For each control c in the form // - If the control is visible...

How do I get the non-maximised window size of a form?

I'm trying to save my the state of a System::Windows::Forms::Form when my application shuts down. I can record the window's size, position and window state without any issues but if the window was maximised when it was closed the ::Size member records the maximised size of the window. Is there any way to record the non-maximised size or...

Document Viewer C# control

I want to create simple file viewer. What control should i use to view office documents (word,excel) in my application. ...

PC Cursor (sometimes) stuck at SizeAll caused by Logitech G9

We've noticed some strange Cursor behavior, which we suspect is a result of one of our Cursor canging methods. Just sometimes, our pc keeps showing the SizeAll cursor. Everywhere, in every application. Now, we never use the SizeAll cursor anywhere in our code, but we can "Unstuck" the cursor when following code is executed. We suspect t...

OnClick event on compound UserControls

I want to create a UserControl with several controls inside. These controls should behave simmilar to the radio buttons, i. e., the status of one of them affects the status of the rest. To do that I would like to be able to handle the OnClick event on each of the controls from the parent. One solution could be to call a method of the pa...

Showing Multiple Instances Of Same Form?

I'm having some serious issues with a WinForm application that I'm working on. Currently, I'm using Form1.ShowDialog(); to display a form. This code is contained in a background worker that looks for changes in a database. Using Form1.ShowDialog(); only allows 1 form to open at a time, even if there are multiple changes to the database...

WinForms ComboBox problem

In a Windows Form Application, I have a ComboBox1 which gets initialized in InitializeComponent() function. I add the values into it in a different function. snippet: public form1() { InitializeComponent(); addDataToDropDowns(); } The problem I have is that, the rows loaded into the ComboBox1 have many cha...

Silverlight app hosted in browser control prompting

I have a Silverlight application that I can run from Internet Explorer 8. When I attempt to host it in a Winforms browser control as described here: http://stackoverflow.com/questions/198360/silverlight-hosted-in-winforms it display a web page that says "To view this content, please install" and has a "Click now to install" button. Unfor...

Determine if windows form is obstructed

Is it possible in .Net (or thru pinvoke) to determine if a windows form is obstructed from view (i.e. other windows have been moved over top of it, so it cannot be seen)? What I am doing is checking if the form is minimized, then flashing the window on the taskbar if it is. However the problem is if it is NOT minimized, but just moved t...

DataGridView how to display grid lines in entire client area?

Hi, Is there a way to turn on grid lines in the entire datagridview client area rather than them becoming visible as you add rows? I have read the msdn but find nothing of use. C#, winforms, visual studio 2008 Thanks, R. ...

Why is there an OnResizeBegin for Forms, but not Controls?

The title pretty much says it all. A Windows Form is a type of Control, and Controls are UI elements that have a Size property along with size-related methods such as OnResize and OnSizeChanged. But Forms also have OnResizeBegin (and OnResizeEnd), which are not found in Control. Is this omission an oversight, a prescient design decisio...

Hosted WebBrowser control attempts to download Flash content rather than playing it

I am hosting an IE browser control in a simple, .NET winforms app. When I make the control navigate to certain content on disk, the control attempts to download the file (rather than displaying the content.) The exact same URL when pasted into the IE browser will properly display the swf file in question along with processed XML data th...

What is the best way to get the value of what user is logged in?

I have a Windows form application that users can log into. The application is alone and doesn't connect with anything or anyone. Besides creating a global variable, how could I have an easily accesible variable to check the current users permissions? A not so kosher way of doing things is just pass the ID of the userType in the Form co...

How to set form object property globally in .net winforms?.

i am using .net win forms i need to set some common properties globally to my win forms like css in web application ex form background color=red button width =100 Text box width=200 font family=arial how to do this? ...

Long Delay when acces to Network Printer.

I have some Delay to access My remote printer, a RICOH offimatic point. I think this delay become from domain autentification. When I call PrintDialog, this delay is about 3 to 5 seconds. I use some .Net programs. Then when I print a report, delay becomes 4x the PrintDialog Delay (15-20 seconds). Standard Programs (c++) get a 1x del...

C#, mouseClickEvent doesn't respond to right mouse click

on click event doesn't respond to right mouse click. The event is for a richTextBox. when I try the same code on the form it works fine. what could be the problem? EDIT: I use winforms ...

AppBar focus issue

I have created an AppBar. The AppBar always stays on top, when it loses focus, then to get back to the AppBar requires two clicks instead of one. I believe the first click activates the form and then with second click I receive the mouse click events (as expected). Can you give any ideas, what can be wrong here? My problem is similar to ...

How to display value from SQL Server database in input box?

I would like to do something like simple data binding in Windows Forms, but in Web Forms. So I would like to get data from a column NAME from table CATS (one row) and display in on website in text box (input type='text') and next I would like to click on "save" button to save this data to database doing an update. Could you please give ...