winforms

ECC Encryption with BouncyCastle for C#

After reading this post regarding the use ECC to implement the hashing using aa private key I set about trying to find an implementation of ECDH and came across BoucyCastle. Unfortunately documentation is minimal (as in zerow!) and I'm unsure what I'm about to accomplish is completely correct/valid. We want to simply hash 4 strings whi...

Problems with Prism hosted in a WinForm ElementHost

I am having problems with hosting a WPF prism app in an ElementHost control and am desparate for help. The PRISM app runs fine in silverlight and in a standalone WPF. The main Shell seems to setup fine in the elementHost on a WinForm however other views only load with the “RegisterViewWithRegion” and not the “Add,Activate” procedure. I...

validation in master-detail datagridview

Hi! I have two datagrids on form. Master presents people and detail their phone numbers. As data source there is two IList: IList<Person> and IList<ContactNumber>. Since the DataRelation object is out I'm using SelectionChanged event on master data grid to change display of contact numbers in details grid (I give null to details grid da...

how do I create an uninstall file for my windows application

I would like to create an uninstall file for my windows application but I am having a difficult time finding information on them. Could sombody breifly explain the workings of a uninstall file and/or provide me with a link to a walkthrough. vs2008,c#, .net ...

.NET ListView and Windows 7

Maybe I'm missing something, but... The ListView control in Windows 7 displays a highlight around selected items that looks like a 3D blue translucent rectangle (I'm not talking about the selection rectangle, but the rectangle around the actual selected items). It even shows a lighter rectangle when hovering over items. However, when I...

Alternative to writing many if statements?

Here is my method: private void ConvertValues() { txtResult.Text = angles[cmbUnits1.SelectedIndex]; double value1 = Convert.ToDouble(txtValue1.Text); double value2 = Convert.ToDouble(txtValue2.Text); int unit1 = cmbUnits1.SelectedIndex; } What I want the method to do is to get the selected of the ComboBox...

How paint.net accomplish it: show pixel coordinates when mouse is moving

There is a picture in my winform, I want to show pixel coordinates when mouse is moving, and whether zoom in or out, the same pixel's coordinates don't change, just like what paint.net does. Appreciate for any idea. ...

Pointing a ConnectionString to a special folder via Visual Studio Designer

I'm trying to set a DataAdapter connection string to point to %APPDATA% from within Visual Studio designer by editing the DataAdapter properties. I cannot seem to be able to use that moniker on the connection string property. It doesn't get translated to C:\Users\MyUserName\AppData\Roaming when I then run the application in debug mode. ...

Using an XML file as my Winforms .NET 2.0 datasource

Is it possible to point to an xml file as a datasource in the same way you would with an .mdf file? Please let me know if I can clarify this question. For example, let's say I have a datagrid and I want to connect a datasource to it and I want that datasource to be based on a local filesystem xml file. ...

Showing non-default fonts in .NET FontDialog

I'm using the standard .NET FontDialog to allows users to select fonts, but it's not showing all available fonts. For example, we have installed Helvetica and that's not showing. The Helvetica is a TTF if that makes a difference. Is there any way I can get it show all available fonts? Thanks in advance. P.S. I'm using .NET 3.5 ...

DataGridView's ScrollEventType.EndScroll

How can i get ScrollEventType.EndScroll in dataGridView's Sroll event handlars mehtod. void dgvMapper_Scroll(object sender, ScrollEventArgs e) { if (e.Type == ScrollEventType.EndScroll) {} } ...

C# WinForms control in .Net COM Server won't redraw

Hi everyone, I have a COM server app which uses some WinForms controls which, frankly, do not seem to be redrawing when their properties (Text, BackColor, etc) are changed. I have tried invoking txtControlName.Invalidate() as well as .Update() and neither seem to be affecting anything. It is a business requirement that we stick to .Ne...

Winforms AutoComplete Texbox Problem..

Hello there.. Look this http://csharpdotnetfreak.blogspot.com/2009/01/winforms-autocomplete-textbox-using-c.html i have applied this for City Field textbox that displays the CityNames on Typing as Suggestion I have taken a DataTable as DataSource which was pre-filled from Database. I loop through DataTable and Add a CityNames to the...

Error handling in multi-layer WinForm App

If I have a multi-layer Winform app with a Presentation, Business and Data Layer for example, and I encounter an error in either the Business Layer or Data Layer for which the only logical action is to log the error and inform the user that an error has occurred where should the logging take place? Should I put the the methods in the Bu...

C# Piccolo ZUI - Squiggles only when CTRL wiggles?

I am using the Piccolo 2D ZUI library in a C# Winform application. One of the examples that the library shows is adding a squiggle (line drawing) handler to the canvas. The problem is that if you enable the squiggle handler and allow canvas dragging then both events occur at the same time. What I would like to do is inherit the PDr...

Datagridview row formatting based on data

I have a DataGridView bound to a BindingSource. Each row has three fields: Name, StartDate, EndDate. Elsewhere on my form, I have a DateTimePicker control. When the DateTimePicker's date is between a row's start and end dates, I want to highlight that row. But I cannot figure out how to do this. Can anyone give me a starting point...

DataGridView -- Simultaneous input and output -- Is this a bug in DataGridView

I have created a C# Windows Forms application which I've attempted to make as simple as possible to demonstrate a problem I am running into. I'm trying to use a DataGridView to allow user input in one column while simultaneously getting updates in another column from a background thread. The problem is that the Input column is effectiv...

Package tsql with application

How can I release a winform application to a user that takes advantage of a local sql database. I would assume that I need to install the database during some kind of setup phase, but is this kind of thing possible? Is there a free version of tsql that can be used in this way? Mysql? ...

Help with structure of abstract class/class/interface Unit.

I am helping my friend develop a Unit Converter. He asked me if I could help split up the work. So I am making a .dll called Unit. Unit is supposed to handle the conversions. I was brainstorm on how to do this and I came up with an idea to put give each section an enum (like enum Angle[Degrees, Radians, Gradians], enum Area[Square meters...

Moving pictureBox in panel

Hello ! I have a project in C#, WindowsForms and I created a panel that contains a pictureBox that is much bigger than his parent. I turned panel.AutoScroll to true and what I want to do is dragging this pictureBox in panel instead of catching a scroll and moving it. I.e. when I grab an image and move cursor to left and down I wou...