winforms

Better Data access components for windows desktop application

Which one can be the better one data access component for desktop application and why? 1.) For MS Access 2007: ADO, OLEDB, DAO 2.) For MSSQL 2005: ADO, OLEDB, DAO ...

Where will the file without path get created in client system

I have the following code in an Winform Application String[] lines = { "LAST MESSAGE", "101" }; File.WriteAllLines("MPP_Config.txt", lines); On my Development system, the file gets created under Bin\Debug... Where will the file be created in the client once it is installed in the client system ? I deploy to a website using Click ...

custom events in child userControls c# .net or Child to Parent Communication in UserControls

Okay here is the scenario: I have a parent "SalesUC" UserControl which contains a "itemDetailsUC" UserControl, as well as a status label. (plz see sample below) What I want: If there occurs any exception in itemDetailsUC, it should be able to communicate the exception text to parent control (i.e. SalesUC). Remember: the "ItemDetailsUC"...

Adding a Design time Panel to a TabPage at run time

Hi, I wish to have a Panel with the controls on it at design time but I want to add this panel to a desired tabPage of my TabControl at run time. I wrote something like this, did not work : the panel does not show up in the tab page. please help me. panel2.Parent = tabGuy.TabPages[0]; tabGuy.SuspendLayout(); tabGuy.TabPages[0].Control...

Calling a function in the Form Class from another Class, C# .NET

Hi, Can someone please let me know by some code how I can call a function located in the Form class from another class? Some code will be of great help! thanks EDIT: This is my current code public partial class frmMain : Form { //*******Class Instances******* ImageProcessing IP = new ImageProcessing(); //************...

'Timeout Expired' error when buffer cache clean

I am going to sum up my problem first and then offer massive details and what I have already tried. Summary: I have an internal winform app that uses Linq 2 Sql to connect to a local SQL Express database. Each user has there own DB and the DB stay in sync through Merge Replication with a Central DB. All DB's are SQL 2005(sp2or3). We...

Why does Application.Exit Prompt me twice?

How can I stop the message box from showing up twice when I press the X on the form ? FYI the butoon click works fine it's the X that prompts me twice. private void xGameForm_FormClosing(object sender, FormClosingEventArgs e) { //Yes or no message box to exit the application DialogResult Response; Response = M...

How can I clear parameter values in the WinForm ReportViewer control?

Hi, I am using the ReportViewer control to show my server report in my WinForm application. I set report parameters like this: List<ReportParameter> parameterValues = new List<ReportParameter>(); ... parameterValues.Add(new ReportParameter("parameter name", "parameter value")); ... myReportViewerControl.ServerReport.SetParameters(param...

Method to register method to be called when event is raised

I have a Panel which contains 20 PictureBox controls. If a user clicks on any of the controls, I want a method within the Panel to be called. How do I do this? public class MyPanel : Panel { public MyPanel() { for(int i = 0; i < 20; i++) { Controls.Add(new PictureBox()); } } // DOESN'T WORK. /...

Having a Backgroundworker refresh splash screen

Hi, Would it be theoretically possible to make BackgroundWorker in a class to periodically refresh existing splash screen form, or is that impossible? (I know that it's probably bad design, but currently I do not see any better way.) Please keep in mind that: I do not want the background worker to do the loading as it would be terrib...

Preloading Winforms using a Stack and Hidden Form

I am currently working on a project where we have a couple very control heavy user controls that are being used inside a MDI Controller. This is a Line of Business app and it is very data driven. The problem that we were facing was the aforementioned controls would load very very slowly, we dipped our toes into the waters of multi-threa...

Proper color names from colordialog

Whenever I run this, and open the color dialog, there are many colors that do not having a proper name, the listbox will show something like "ffff8000"(Orange-Yellow). Is there another way of pushing the proper name? Is there a proper Color Name library I can reference in code? colorDialog1.ShowDialog(); cl.Add(colorDialog1.Color...

WPF exception handling when launched from WinForms

so i came across this interesting article on WPF exception handling: http://srtsolutions.com/public/item/251263 it works by declaring DispatcherUnhandledException handler in xaml <application> node. but what if a WPF window is launched from win forms application? where can i declare a general exception handler? The problem is that...

Global hotkey capture in VB.net

I want to have my app which is minimized to capture data selected in another app's window when the hot key is pressed. My app definitely doesn't have the focus. Additionally when the hot key is pressed I want to present a fading popup (Outlook style) so my app never gets focus. At a minimum I want to capture the Window name, Process ID...

DBConcurrencyException in winforms app due to munged time portion of datetime field

Hey All, I've got a winforms .net 2.0 application that's hitting a MS SQL 2008 server. I load up a DataSet from that server, expose a bunch of that dataset via bound winform controls & then push updates via SqlDataAdapters. One such adapter is attached to a table w/two key fields RecruitID and StatusDate. StatusDate is a DateTime fie...

Adding the same Panel to multiple TabPages

In my previous question I could add a design time panel to a tab page at run time and my code looks like this and it works Ok. tabControl1.SuspendLayout(); tabControl1.TabPages[0].Controls.Add(panel1); tabControl1.ResumeLayout(); but now I need to do something like this: tabControl1.SuspendLayout(); ta...

Where should an application's default folder live?

Hi: I'm creating a little app that configures a connected device and then saves the config information in a file. The filename cannot be chosen by the user, but its location can be chosen. Where is the best place for the app's default save-to folder? I have seen examples out there where it is the "MyDocuments" location (eg Visual Stu...

Testing UI with MsTest

With NUnit, I could use NUnitForms to test the UI. It's massively cumbersome, but it gets the job done. Is there something similar for MsTest for the version shipping in VS2008? ...

passing something from child form to parent

so i have this form and on it is a combo box populated from a database via a SQL method. and i have another form which allows us to maintain the database table etc. so i make a new instance of the second form doing: Form1 frm = new Form2; frm.show(); once i have done what ever i wanted to do on the second form and i close it, i need...

How come nobody wrote RadioMenuItems class for Winforms?

Or maybe google is just not so friendly to me? What I want is this simple thing: constructor that accepts an array of menu item objects Value get/set property that would set all the Checked properties right bind to all Clicked events of the supplied items and provide One event Working DataBind facilities If you encountered such a n...