winforms

C# WinForms StatusStrip - How do I reclaim the space from the "Grip"

I've got a StatusStrip with a single ToolStripStatusLabel, Spring=true and a background color for notifications. The problem is that there's an ugly gray square on the right side of the status strip. After fiddling for a while, I realized this is the sizing grip (I had is set to SizingGrip=false, GripStyle=Hidden). Yet even with it hi...

C# cross thread dialogue co-operation

K I am looking at a primarily single thread windows forms application in 3.0. Recently my boss had a progress dialogue added on a separate thread so the user would see some activity when the main thread went away and did some heavy duty work and locked out the GUI. The above works fine unless the user switches applications or minimizes...

How to get the text from a selected row on Winforms DataGrid?

OS: Windows Mobile 6.5 Language: C# This seems like it would be easy but i can't find a way to retrieve the text from the selected row on a DataGrid. The grid is single row selected only - no multiple row selection is allowed. ...

Spectrum Analyzer for line-in?

I'm looking for a small control (and the code behind that analizes) that shows me the incoming sound of my line-in/microphone. I'm using winforms with c# and the control might if possible fit my toolbar. ...

Fill WinForms DataGridView From Anonymous Linq Query

// From my form BindingSource bs = new BindingSource(); private void fillStudentGrid() { bs.DataSource = Admin.GetStudents(); dgViewStudents.DataSource = bs; } // From the Admin class public static List<Student> GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = (from s in conn....

Creating Options Menu with overlapping panels

I'm trying to create an options menu in a C# forms project, and I'm curious if there's a less ugly way to do this. I have a ListBox that has the different categories of options, and when you select a category, the options for that category appear in a panel on the right. Basically, something identical to the options menu in Visual Studio...

What could make GetCursorPos return incorrect coordinates of {0,0} ?

We are seeing bad behavior in an application when it runs on Server 2008 (not R2). This is a WinForms application, and Control.MousePosition is returning {0,0} no matter where the mouse is on the screen... Control.MousePosition just makes a P/Invoke call to Win32 api GetCursorPos(). Followup: I am using Control.MousePosition from W...

Click once Deployment suddenly does not work. Displays windows login?

Hello All, I am facing a peculiar issue. We use click once deployment for our windows application. It was working fine till last week. I made some changes to the application (just code nothing changed in properties) and suddenly I cannot publish anymore. When we give publish now it displays windows authentication dialog and when we prov...

Concatenate hex numeric updowns to string for a textbox

I have 4 numeric up down controls on a form. They are set to hexidecimal, maximum 255, so they'll each have values from 0 to FF. I'd like to concatenate these values into a string for a textbox. ...

Embedding Mappoint 2010 Control in C# WinForm Creates Registry Error In Win7 (64-bit)

I have a WinForms application with an embedded MapPoint control that I've been maintaining for about 5 years now. The application originally used MapPoint 2004, then 2006, and now we're upgrading to 2010. Within my development environment (VS2008/.NET 2.0 for the project) the application runs fine. Once I create an installer and insta...

C#: Adding Columns To Bound DatagridView With Code

// Getting data from this Admin class: public static IQueryable<Student> GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = from s in conn.Students join b in conn.Belts on s.BeltID equals b.ID orderby s.LastName ascending select s; return query; } // And on my fo...

How to test localized winforms application?

Background: I have created sample windows application for learning to implement localization. My each form has two RESX file. One for Bulgaria and one for French(Belgium). It has default culture English(XX) To test locally currently I am programmatically changing UICulture i.e. Thread.CurrentThread.CurrentUICulture = new CultureInfo("f...

Simple Windows.Forms binding is failing using framework 4.0.

This works under the .net framework 3.5 client. This fails under the .net framework 4.0 client. Was I doing something that was illegal under 3.5 but just happened to work, or is this a bug? Note that in my project 'PropInt' does not raise change events so using ctx[obj1.PropObj2, "PropInt"] is not an option. public class Obj1 { ...

MainMenu with Images (WinForms, C#)

Hi All I have a MainMenu in my app and I would like to have little icons relevant to the Item in each menu. But the MainMenu control does not support this. I would use the MenuStrip control, though that is a pretty ugly option in my opinion. Does anybody have any suggestions? Are there any free/open source alt's out there, or would it...

Install Dll in the GAC for .Net

Hi all, I am a beginner in .Net development. I need to ask about .Net winform deployment. If i have 1 exe file, some class libraries, and 3rd party components (DevExpress). Should i install these Dlls (class library and 3rd party component) in the GAC (Global Assembly Cache) in client computers ? Thank you for the explanations. ...

WinForms modal windows alt+tab problem

Hi ! Suppose multiple Modal Windows shown above each other. All of those have ShowInTaskbar = false, which means that in the TaskBar you only see the MainForm and all Modal Windows are hidden. Now you press ALT+ TAB and the most upper modal Windows disappears. But you cannot get it back in front. How should be this done correctly in...

How can I bind a custom property of a windows form to a second property?

I want to bind a custom property of a windows form to a second property, so when I update the former the latter gets the same value. This is the simplest example of what I'm trying to do: public partial class Form2 : Form { public string MyTargetProperty { get; set; } public string OtherProperty { get; set; } public...

Suggest any Error Logging facility for Winforms application for writing error in a remote database

My team working in a project using Winforms application(c#) & MSSQL 2005 as database. When I searched the goggle,I found ELMAH, NLog & log4net.I didn't have enough knowledge to implement in Winforms application. Please suggest any reference/library for writing Error Logging for Winforms application & to store in a remote database. ...

How can I provide a different rendering target to Direct2D?

I'm using Direct2D in C# to render a small gui framework for my research project. I'm not very used to working on Windows or with DirectX. I'm using a Windows Forms control to create a render target, and msdn warns that since it uses BindDC, a the larger the rendering target, the worse the performance will be (which turned out to be a dr...

How to close only single dialog on ESC key in WPF/WinForms?

I have a WPF form. It handles the KeyUp event and if the released key was Escape, it closes itself. Also this form has a button to show some Windows Form as a dialog. It does handle the Escape key in the same way. What happens is that when I press Escape when in the child dialog, both windows close. I expect only the child Windows Form...