winforms

How do I programatically raise an existing event within a custom control?

I have made a custom class by inheriting a DateTimePicker and made some methods that allow it to be blank/null. If the control is blank and a user clicks on it, it populates with the current date. It also raises the ValueChanged event. If the control is populated and a user presses delete, it clears and sets its value to null, but the ...

How To Disable Desktop and/or Taskbar

I know the implications of this but a client was insistent that they wanted a program we've made to lock the desktop and/or taskbar so as to prevent the user from switching programs. I'd already explained the implications of this but they were still insistent that the desktop be locked down. How is this behavior possible? I'm using .NET...

Is there any way to focus ( tab control ) picture box ?

I am working on .NET 2.0 with C#. How to make focus the control to picture box after pressing the tab from text box ? Please, give me a solution. ...

Where to get a Compiled "Windows Ribbon for WinForms 2.2"?

Hi, I am just wondering whether anyone knows where I can get a compiled version of Windows Ribbon for WinForms 2.2? I can only download the source from the website and as I don't have the Windows 7 SDK (and can't download) I can't compile it. ...

Is MVP pattern best way for every winforms app?

HI, i would like develop application about storing some information about books, i would like use MVP pattern - but i have some doubts if this pattern is always best practise for developing small/mid winform apps or maybe is not necessary? ps. I would like use Smart Client Factory from Microsoft, is there any framework for MVP in winfo...

CellDoubleClick event doesnt work after addition of Drag&Drop

After I added drag & drop to a DataGridView, the CellDoubleClick event stopped working. In the CellMouseDown event I have the following code: private void dataGridView2_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { var obj = dataGridView2.CurrentRow.DataBoundItem; DoDragDrop(obj, DragDropEffects.Link); } How...

Microsoft office assistant

Hey all, Do you remember this cute little one? I need something like this to add it to my project, in order to give user some instructions. I have like step by step procedure and I need to give user "To do" hints, do you know any library that offers me such a thing? ...

Best way to limit textbox decimal input in c#

How can I make a textbox in which can be only typed a number like 12.00 or 1231231.00 or 123123 I've done this in a very long way and I'm looking for the best and fastest way. Also the decimal separator must be culture specific.: Application.CurrentCulture.NumberFormat.NumberDecimalSeparator ...

Changing a window's restore position using SetWindowPlacement doesn't work on every window

I'm using the SetWindowPlacement function to (1) maximize and (2) change the restore position of external windows on the desktop. But when I use this command on WinForm windows, it doesn't seem to set the restore location correctly. (The WinForm window I'm testing with is just a VS2008 WinForms application run without modification.) So, ...

New autoNumber cells in dataGridView get the values -1,-2...etc

I have an access database table that has an autoNumber column, and the table is connected to a winform through a dataGridView. Now every time I add a new row, the autonumber column cell of the new row is set to -1,-2,-3...etc instead of 28,29...etc how can I fix this. Using Visual c#2008 express on XP. ...

How to download files from Megaupload?

Hello. Can anyone tell me how to download files from MegaUpload using C#? So really, a Megaupload download manager. I've looking for a API, but I've been unable to find one. I want users to be able to use their own Username and Password from Megaupload. Thanks. ...

Fill dataGridView thank's to backGroundWorker

Hi I have this code sinnpet private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { remplirDataGrid(); } private void frmChercherActesLoad(object sender, EventArgs e) { backgroundWorker1.RunWorkerAsync(); } private void remplirDataGrid() { ...

ZedGraph in C #: no point shown.

Hey; i am trying ZedGraph in windows form. i imported the dll and it shows in UI designer successfully. when i compile and run the program. it pops up the zedgrah grilled view, but no points on it. could anyone help me see what was wrong? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; u...

How to call the non Default constructor with assembly.CreateInstance

hey all, I need to call the Non default constructor when using assembly.CreateInstance. how? ...

How to avoid implementing INotifyPropertyChanged manually

Is there some way to avoid this. I have a lot of classes that are bound to DataGridViews and they are just simple collection of properties with default getter and setter. So these classes are very simple. Now I need to implement INotifyPropertyChanged interface for them which will increase the amount of code a lot. Is there any class tha...

Mdi parent form with other mdi parent form as a child

I would like to create two mdi parent forms one containing another. Is it possible to so? ...

Hourglass problem in a WinForm application

Hello everybody, In my program with a UI in WinForm. I set the cursor to a hourglass just before to launch a method in ThreadPool. My code in UI thread to set the cursor looks like this : Application.UseWaitCursor = true; When the method is finished, i go back to the UI Thread to set the cursor to the normal case. Application.UseWa...

Problem with BackGroundWorker

Hey all, I'm using a BackGroundWorker to avoid UI freezing while working with a method which uses wait handles, and this method is used to draw on a panel in the UI and has panel invalidation inside. something() { draw() panel.invalidate() A.waitone(500) } The problem is, sometimes the Worker gets stuck in the middle of the dra...

Add open file dialog to dll library

Several forms from my application use the same "open file dialog". I need to duplicate a code for "open file dialog" and its settings every time. I want to add "open file dialog" to separate dll library to avoid duplication. How do I do it ? WinForms, Visual Studio 2008. ...

Problem in Using Context Menus?

I am using Windows forms in .NET 2.0. I have used Split Container in my application with two Context Menus. I want that one context menu is associated with panel1 of split container & another context menu is associated with panel2 of split container. Till Now the things go very fine. I am using context menu property of panel1 & panel...