winforms

How Can i View Column Name Values on DataGridView?

CourseID, ProfessorId and StudentID are foreign keys, i want to print CourseName, ProfessorName, StudentName instead of ID's. I'm using the wizard (typed dataset). Note: the three id's are of composite pk as well fk, so no duplicate records will appear. What can i do? ...

Refactoring Form.ShowDialog() code to MVP

Hi All, I have a WinForm and few properties that are set on it. for example : Name,Address are accepted on the Form. (many more properties in actual example) The current implementation is somewhat similar to frmName frmView = new frmName (); //frmName is WINFORM frmView.Name= "ABC"; //any valid string or read this from file frmV...

C#: data-binding objects such as DataGrid

C#: if you bind a DataGrid object to a List object and set the columns to show properties of List's objects, will the DataGrid update when the data-object does? Is it advisable to data-bind DataGrids? Isn't it better for the programmer to control this process themselves? ...

C# Getting a component's values at runtime?

I'm attempting to create a NotifyIcon that can be inherited so that I can add my own properties/etc. Through looking at a component class someone else wrote, I've made some progress as can be seen below, and the component can be dragged into the form. To be honest, I have little idea on what I'm doing, and there appears to be no tutorial...

Spreading the contents of a DataTable into 3 DataGridViews

Hello, Let's say that I have a form which runs a stored procedure. This stored procedure creates some rows in a table with pre-generated values and returns me a DataTable containing the rows created by this stored procedure. On the form, I need to display this information on 3 different DataGridViews, so the user can change it. The sch...

Using ASP.net credentials to log in from a WinForms application

Hello, We have an ASP.net application but some screens are deemed too slow to use by our users. As a result, we are trying to provide a WinForms-based alternative to those data-input centric screens so we can use richer controls like Grids with immediate screen updates and feedback for the user. Ideally, I would like the users to login...

numericUpDown prevent rounding int

hi, I'm using numericUpDown with C# to represent integers. But there is a problem representing "big values". For instance if I assgin 127 to numericUpDown, it's displayed correctly. However, if I assign 12912347 it gets rounded to 12912350. How can I avoid numericUpDown rounding integers? (numericUpDown settings are: DecimalPlaces 0; M...

.net gridview record count

Hi IM sure there's an easy way round this.... If I populate a gridview by eg, selecting a value from a dropdown list, then I want to show the total number of records in that gridview, i have a textbox which i set to lbTotal.Text = Convert.ToString(gridview.Rows.Count); Problem is, is only shows the total for what was previously ...

How can I move windows when Mouse Down

we able to move windows forms when we mouse down on title bar . but how can I move windows when mouse down in form ? ...

Create a Login Form

I have a form that I want to provide some security on, but up to this point I've only created one form that does all of my work. I want to create a new form that pops up in front of my main form right when the application launches. Then validates the password entered against a MySQL database. I have all of the MySQL stuff down, but wo...

Get the point of click on a control

I am using an old ActiveX control in my C# Win App. it has a MouseUp event that its eventArgs is passing the X and Y of the point that we have clicked but for my scenario I am using its ItemClick event and its eventArgs does not have the info about X and Y. but I need to know them to show my pop-up... so is there a way I can find out wha...

SaveFileDialog keeping folder in memory

So I'm using a SaveFileDialog to save a file to a location the user selects. After the saving has occurred, the user is able to do what they want with the file and folder they saved to. However, the user cannot delete or modify the folder...it's being held in memory by the application so when another SaveFileDialog is opened, it can po...

Expandable Groups in Windows Forms ListView control

How do you make the item groups in a Windows Forms ListView control collapsible and expandable? ...

Strong typed Windows Forms databinding

Edit: I prefer this solution I found eventually in Google's cache (it has been deleted from the author's site) as it only needs one type specification and does it in a way I haven't seen before. I don't know why the original author deleted it. // Desired call syntax: nameTextBox.Bind(t => t.Text, aBindingSource, (Customer c) => c.FirstN...

How to make .exe file programmatically set to run as admin always in vista?

I have written a winform application in C#. When I run the program for some functionality it required admin permission. After Installation If I set the .exe file to run as admin manually (by clicking right mouse button on .exe file) then my program run perfectly. Now I need user not to set the run as admin property after installation by...

hook on default "Paste" event of WinForms TextBox control

Hello, I need to "modify" all pasted into TextBox text to be shown in some structured way. I can do it with drag-n-drop, ctrl-v, but how to do it with default context's menu "Paste"? ...

How to code a Button's Click Event?

I'm using winform and fb.net. Can someone provide me with an example of how to create a buttons click event? I have dim but as windows.forms.button but.name but.text but.location etc. but I how do I create the Click and the code behind it? ...

Windows Form calls Web Service but needs to impersonate a different Windows user

I have a Windows Form app (4.0) that calls a Web Service (WCF) but needs to impersonate a different user than who is currently logged inot the machine. How can that be done? Right now the Web Service is failing to return records because the user does not have the rights. I need to use a different user for the Web Service call. ...

Updating property in PropertyGrid when value of property is changed elsewhere?

Hey guys, We have an object that is assigned to a PropertyGrid using the SelectedObject property of the PropertyGrid. This object contains a few properties which get updated by code in various places. For the purpose of this example, assume one is a simple update (ie: caused by the following code - Person.FirstName = "Gareth"), and that...

Changing the opacity of individual form controls in .NET

Ok, so what I'm trying to do is have two imageboxes overlapping so that I can align the images in them (based on user input). The problem is I'm not sure if I can adjust the opacity of individual controls so I can only see the topmost control. Of course, I could do image processing and combine the two images into a single image (with the...