winforms

Using Windows Principles/Roles to programmatically control access to Controls/Forms - C#

The application in question is a fairly extensive with many different types of access roles (read Customer Service, HR, Admins, etc etc). Tiered access, so each role inherits the access below it, so HR has Read Only, CS has edit abilities, Admins full control. Menu bars and buttons enable/visible attributes are controlled by an outside a...

change color menu in design time

There is any form to change the menu color when the mouse is over it in designing time in visual studio 2008? Or at least change all the menu items at the same time in execution time I'm using windows forms ...

Caching problems when developing type converters and editors in the ide for vb.net, winforms.

Any time I make a change to a type converter or editor, I have to close down my visual basic 2008 express ide and restart it. If i don't restart, the following problems occur: (1) The designer shows what appear to be random errors. I solve this by running the app, so not a real problem there. (2) Serialization of design time propertie...

Open a file from a remote network share

I am trying to open a file from a server I currently have Dim attachedFilePath As String = "\\myserver\myshare\test.txt" File.Open(attachedFilePath, FileMode.Open, FileAccess.Read, FileShare.Read) This does not open a file. However, if I change the path to be local then there is no issue. Dim attachedFilePath As String = "c:\...\t...

Problem with CreateGraphics and drawing strings

C# WinForms CreateGraphics Problem The control below draws a string in a rectangle. On mouse move there is a hit test on the string rectangle, and the string is redrawn via CreateGraphics. The irritating problem is that the text is not drawn the same as in the Paint handler; it appears to be displaced by about 1 pixel, and the effect is...

C#: How do I repaint my form when it's not focused?

I want to repaint/invalidate/refresh my form so that it updates seamlessly when it's not focused. How can I achieve this? Right now it will only update itself when I give it focus or move my mouse over it etc. Edit: I tried using a timer that would call this.Invalidate(); every 25millisecond ...

Silverlight hosted in Winforms: Alt+Tab focus behavior

We have a WinForms window with a WebBrowser control in it, pointing to a page with a Silverlight 3 control on it. If a Silverlight control has focus and you Alt+Tab away and back again, the focus is gone. Strangely, if you do the same thing again, focus returns to where it was. I’ve tried to manually re-focus the Silverlight control aft...

C#: How do I get the coordinates of my mouse when left/right mouse button has been pressed?

How do I get the coordinates of my mouse when left/right mouse button has been pressed? I am using a low level mouse hook and am able to get the current position of my cursor, but I would like to be able to retrieve the position when any mouse button has been pressed. How can I do this? ...

Winform BindingSources - Question

I have a windows form (net 2.0) with controls on it bound to an entity (w/ INotifyPropertyChanged) through a BindingSource..works. On the same form I have a drop down list that is also wired up through a BindingSource..works Here's a sample of the relevant code: m_PlanItemLookupBindingSource.DataSource = GetBusinessLogic().RetrievePay...

Setting the filter to an OpenFileDialog to allow the typical image formats?

I have this code, how can I allow it to accept all typical image formats? PNG, JPEG, JPG, GIF? Here's what I have so far: public void EncryptFile() { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; dialog.InitialDirectory = @"C:\"; ...

Winform size changes

Hi, When i run the EXE of winforms it runs perfectly in 14 inch monitors , but it rearranges and the contents shrink and look bad when i run the same EXE in 12 inch monitors. Has .NET Exes have some issues with the monitor size? Please help me. Thanks, Karthick ...

where is the better place to do initialization work in winform?

In the Load event or in the constructor after the InitializeComponent()? or doesn't matter at all? ...

Windows Forms resolution problem

I have developed a 1024 *780 resolution screen in Windows Forms, but some say that it does not fit properly at higher resolutions. Is there any way to handle this? Is there a way to make Windows Forms applications look the same at ALL resolutions? ...

HelpRequested event not getting fired for a panel

Hi there, I was trying to write a form in C# in which the Help on the form is enabled. Now when I try to click the '?' button and then click the panel, the HelpRequested event is not getting fired. On the panel I have custom drawing. What can I do for this? Thanks, Datte ...

Error "Failed to create component 'ControlName' " when dragging a windows forms user control to a form

I have a windows forms user control in my project. It has been working on a form with out any issues but suddenly i can no longer use it on any other form. If i try to drag it from the toolbox to a new form, i get this error message "Failed to create control 'controlName'. The error message follows: system.ArgumentException: the specifi...

How do I get the total rows per group with the Janus GridEx for WinForms?

I am using the Janus GridEx (Windows Forms) and would like to export the contents to Excel. We have used the export functionality that Janus has built in before, but especially with hierarchical grids the exported file looks unprofessional. So now we have written our own exporting code and everything is working fine, except that total ...

External images in .rdlc data reports for winforms

I searched google for days to show images on .rdlc datareports but still not found s soulition. I have set: reportViewer1.LocalReport.EnableExternalImages = true; Image properties to "External" and have set parameters value to the value property. ReportParameter Path; Path = new ReportParameter("Path", "C:\\Test\\579569.png")...

Is there a C# method similar to Javascripts OnBlur?

I am creating a windows form in C#, I have phone and email fields that I want to validate when the user leaves the fields, when I double click the textbox in visual studio, it writes a textchanged event, I don't want to call the validate method until the user is done entering the full entry. Is there a way to do this similar to OnBlur...

c# asp.net use Windows Forms WebBrowser

Hi I have a class of library code which uses a System.Windows.Forms.WebBrowser control to load a web page then extract information from the DOM tree, etc... I've found this to be the only reliable way to be able to parse information loaded onto a page with javascript, etc... This worked fine when testing with console app, but when I ca...

Creating a flicker-free text box that can be rapidly updated

I'm trying to create a search tool and would like to display the results in a text box, much like the one contained in Visual Studio - this means that for long searches results will be appended to the end of the text box while the user is attempting to look at the results at the top of the text box. At the moment I'm using a standard te...