winforms

Winforms using BackgroundWorker to cycle through Datatable

Hi! Please could you give me your thoughts on the following (especially if its advisable or not to do so)... Basically, I can successfully import CSV data into a datatable and then bind that datatable to a datagridview. What I would like to do now is run through some validation checks for each row in the grid. Each row will have its d...

DataGridView and Combobox Column?

when DataGridView has a combobox column, how can I get the text it displays as oppose to the value it represents? When I do DGV.Item("cbo",i).Value I get the value but it won't take DGV.Item("cbo",i).Text. I trying Ctype(DGV.Item("cbo",i),ComboBox).Text and this does not work either. ...

Icons on Titlebar

Hi Everybody, I just found something really cool and i'm surprised i didn't really notice it sooner. Have you ever seen WordPad running on Windows 7? If you have, you'll notice that on the top-left of the window's titlebar are a few icons (save, undo/redo). On the actual titlebar itself! How cool is that? I was wondering how i would imp...

using linq for this:

hi all i have just started learning linq because i like the sound of it. and so far i think im doing okay at it. i was wondering if Linq could be used to find the following information in a file, like a group at a time or something: Control Text Location Color Font Control Size example: Label "this is text that will appear on a lab...

DesignSurface and Zoom

I am trying to implement Zoom feature on a DesignSurface, which uses .Net 2 based Designer time architecture. I have two approaches to handle ZoomChanged event: Unload the Design surface and reload with Zoomed content. Identify the affected properties and set them to Zoomed values of properties. Problem: In approach 1, Unload and...

Form changes size between constructor exit and begining of Load C#

Hi, I am rather baffled at the moment, I have a form which I show as a dialog (although non dialog is the same) in response to a menu item click. var createUser = new FrmCreateUser(); createUser.ShowDialog(); Somewhere between the constructor exiting, and when the load event is fired the size is being changed. I have overload...

DataGridView & ComboBox Event ?

Using VB.Net, I have a DataGridView with a ComboBox Column. What even do I use for when the user changes a selection in the ComboBox? ...

Authorization and authenthication for WinForm application

Hi! I'm starting to develop windows application and I've been looking around for some authenthication and authorization solution available, but no luck so far. I have to be able to allow admin create users and roles, assign users to roles and define access to controls on form for specified roles (button enabled/disabled etc). Is there...

Slow screen drawing in .Net C# winforms application

I have a very large C# .net 2.0 winforms application which has some drawing issues. When going into different forms you can see controls being drawn and even the title bar of the form being resized and then disappearing. The base form that all other forms inherit from has the following code in its constructor. Including setting DoubleB...

Winform, authorization on ui

0 vote down check I'm thinking on creating standard users, roles, permissions table schema, add contorls table and permission would be 'for a role on a control' and then in form loading event fire up a method to set Enabled proprerty of controls due to user's role's permissions. Is this good idea or i should took a hammer and get this ...

Why isn't PictureBox.Image autoscaling to fit in?

Hello, I've an interface where user selects picture (using OpenFileDialog) and its shown in a fixed size picturebox. I want this picture to fit in the picturebox even if the resolution is high. What property do I need to set inorder to let my image AutoScaleToFitIn the PicutreBox? ...

set tag in DataGridViewRow from DataTable automatically

Is there a way to use a column of data from a DataTable to set the tag of a row automatically instead of having to iterate through each row in the DGV to manually assign it? MyDataGridView.DataSource = GetDataTable(); foreach (DataGridViewRow dgvr in MyDataGridView.Rows) { dgvr.Tag = (int)dgvr.Cells[0].Value; } I have a large amount ...

Determine when a mouse hook has handled the last message. Winforms, .Net

I have a form, that acts like a drop-down, that I display non-modal. I attach a mouse hook to the form to determine when the mouse is clicked out of it, so that I know to close it - by setting Visible = False. Because I want the HookProc to handle the last click, I can't dispose the Hook or my Dropdown until I'm sure that my event handl...

How do I specify what the column type a DataGridView chooses to use when using DataTable as its DataSource

I have a column in my DGV that is a custom type to display values of MyObjectType. My DataTable has the column created as MyObjectType, but the DGV creates a DataGridViewTextBox column and populates it with MyObjectType.ToString(); which is not the behavior I want. Can I either force the data to be loaded into preexisting columns; or...

How can I use LINQ to match words

I have a fair amount of questions and my first one is how can I do a simple LINQ query to match a word in a file? I'm not trying to be stupid but i haven't understood the documentation that I found for LINQ properly. ...

Why is the control inaccessible due to its protection level?

I'm trying to access a control's text property from program.cs and it says that it is inaccessible due to protected level. How can I fix this please? ...

Best way to manage ListViewItems in a Detailed ListView?

I've adopted the following pattern for putting ListViewItems in a ListView with multiple columns (when I want to display information about a list of MyObject types), and I'm just curious to see if this is the best way to accomplish this task, or if there's anything more efficient and readable in code: Create an inherited ListViewItem c...

Displaying an EMF file

Hey guys! Got a quick question about Windows EMF/EMF+ files. Reading the documentation, I realize that an EMF/EMF+ file is just a bunch of GDI/GDI+ commands. So what's the supported way for reading in an EMF/EMF+ file and then displaying it in either MFC or WinForms? Thanks, Alex ...

Is there a standard way for .NET Winforms apps to auto-upgrade?

If you have a Winforms app that is installed on a large number of machines, is there a standard way of implementing an automatic upgrade function? e.g. Each time it is started, it checks a web site or web service and if there is a new version available, it downloads and installs it? I could figure out how to roll my own version of this...

SoapExceptions error: The property 'Name' is read-only and cannot be modified or deleted. (SSRS)

Hi, I have created a Windows Application based UI using C# to enable users to manage the items of the Reporting Server. One of the functionalities I have implemented was to right-click on the name of the folder (in the UI TreeView hierarchy) and choose the 'Rename' option from the menu, which will then call the ReportingServices2005.Set...