winforms

How to save position after reload DataGridView

this is my code: private void getData(string selectCommand) { string connectionString = @"Server=localhost;User=SYSDBA;Password=masterkey;Database=C:\data\test.fdb"; dataAdapter = new FbDataAdapter(selectCommand, connectionString); DataTable data = new DataTable(); dataAdapter.Fill(data); ...

Can I deploy SQL Server Express with my desktop application just like builtin database?

Can I deploy SQL Server Express with my desktop application just like builtin database? Because I don't want my client to set up separately SQL Server Express! Is it easy to integrate SQL Server Express into my desktop application ? ...

How can I easily keep consistent UI settings in C# Winform application?

I have a lot of different UserControls and would like to maintain consistent UI settings (mainly colors and fonts). My first try was this: public class UISettings { //... public void SetupUserControl(ref UserControl ctrl) { ctrl.BackColor = this.BackColor; } } to be called in every control like this: settings.Setu...

[C#][XNA 3.1] How can I host two different XNA windows inside one Windows Form?

I am making a Map Editor for a 2D tile-based game. I would like to host two XNA controls inside the Windows Form - the first to render the map; the second to render the tileset. I used the code here to make the XNA control host inside the Windows Form. This all works very well - as long as there is only one XNA control inside the Windows...

User Drawn Controls: the MSN chat window

I'm wondering about the famous MSN chat clients conversation windows! I'm sure there must be a lot of different aspects but I'd like to focus on those little sliding panes. For instance where the pictures of the people in the conversation are displayed. When you click the collapse button the pictures disappear and the panel gracefully sl...

How to have a transparent number on top of a winform?

So I have a winform that has some winforms controls on it. But in the center of it, I want to show a transparent number on top of everything. Say 60 pixels size. I tried a label and even tried to create a custom control but the transparency didn't work. Any ideas how to do this? This number will change programmatically at runtime seve...

WinForms Load Event / Static Initialization Strangeness

Background I'm troubleshooting an WinForms 2.0 program that's already been burned to CD for distribution to an internet-challenged target audience. Some users are experiencing a fatal error that I can reproduce locally. Reproducing the Error I get the fatal error when I log into my Vista box using a standard user that I just created,...

Whats the best way/event to use when testing if the textbox text has finished a change of text

using winforms, c#, vs 2008 So i have textbox1, textbox2 and textbox3 on a winforms. Textbox3.text = textbox1.text + textbox2.text. I need textbox3 to be updated whenever the contents of textbox1 and textbox2 have been changed either manually or programmatic. The problem is if i use textbox textchanged event it keeps firing as one ty...

Why do .NET winforms scale improperly at large DPI settings?

My .NET application (VB.NET 3.5 if you really must know) forms do not properly format when rendered at high DPI settings. All of the fixes I've found so far simply explain the cause of the problem as "certain UI elements do not scale properly". I was wondering if anyone had a more meaningful explanation? Thanks! ...

Consume windows form events in C++/CLI

How do I add an event handler method to, say a TextBox's TextChanged event ? ...

How to store the file in the database ?

How to store the file which is uploaded by the user to the database ? I want to store the file in the database how can we do that ? In the back-end I am using sql with c#.net application. ...

Rich Text Editing in Windows Forms

I am using following text editor for my windows forms application http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx This works great and a wonderful control, however I am trying to accomplish one task i.e. I wanted to insert a custom tag to the underlying html for eg if user clicks on a button on form I want to insert a t...

How to create a PeopleEditor ?

Hi, I am building a windows application that upload documents to sharepoint document library and modify its column. My problem is that i'm uploading a file to document libary that has a people editor column. To solve my problem I want to pop up a windows form containing a people editor so users can pick the users or groups to fill in t...

send credentials to WebBrowser

Hi, I have a webbrowser control that navigates to sharepoint port. How can i send credentials to webbrowser control, so i can navigate to the site with custom credentials? ...

How could I click in a control and drag (not Drag and Drop) out of it but still follow the event as long as the button is clicked?

Hello, I would like to allow the user to click within my UserControl and drag left/right to zoom in/out but I'd like the dragging not to be restricted to the actual control's boundaries. What sort of event or strategy would be the right way to track the mouse position outside the control and the form until the mouse click is released ? ...

How find a SubForm of a application with changing texts?

Hi, I have Application X with Subform x1, x2, x3. The Subform has, because its multi-language, not a static text in it, neither a specific window header text or something. What can I do to find this window in my code an react when its open, e.g. with a messagebox? ...

C#, treeview, multi-colo(u)red treenode text

Hello guys, How can I change a color of some part of treenode Text ? For example, first symbol is red, last symbols are yellow .. ...

System.IO.File.ReadAllText(path) does not read the html file.

I want to read the html file.And for that I use System.IO.File.ReadAllText(path).It can read all the html file but there is one file which is not read through this function. I have also used using (StreamReader reader = File.OpenText(fileName)) { text = reader.ReadToEnd(); But still there is same problem. What is the reason can b...

How to bring a form in the top of desktop?

hi, I want to pop up a form in C# .net 2.0 which should be in front of the desktop (topmost) until the user clicks the close button. How to do so? I tried the code from here: http://dotnet-snippets.de/dns/fenster-wirklich-in-den-vordergrund-des-desktops-bringen-SID1005.aspx But it didn't work. My system is Win7. ...

Implementing Read Only view in Winform App

I have an in house winform app for viewing, editing, and inserting member data. There are about 40 sepertate form pages that they use to manipulate different portions of the data. My question is this; What is the best way of implementing a read only view for a form page? My thoughts were to cycle through the controls setting Enabled ...