winforms

Using Entity Framework with repository pattern in WinForms MDI

Hi, We are about to start up a new project similar to a previous one. I could just copy the old design but I am not all too satisified with the old design. It is a "standard" business system (sales,stocktaking,warehousing etc) built ontop of .Net 3.5 (Winforms MDI) with Entity Framework in the backend. All forms inherit from a basefo...

C#. Displaying and moving icons on a windows form.

Hi, I need to display a set of Icons on a windows form and move them around at run-time. I have used the PictureBox control to display the icons but I would have to either not change the picturebox.SizeMode to Stretched, which results in very small icons, Or they would look blurred and horrible at run-time even though they are high quali...

How can I keep separation of concerns when using a grid in the presentation layer (esp. .NET)?

In a three-tier model (presentation-business-data access layers), I can consistently keep my lower layers agnostic of the upper layers. For example my data access layer never knows how it is presented or what busines rules are operated on it. My business rules are agnostic of how they're presented. But I must pray to Demeter for forgiv...

Not sure how to use Dependency Injection + Repository Pattern + Unit Of Work Pattern with a WinForm application.

(apologies for the Wall Of Text... :) ) Summary Using Dependency Injection with my Winfor application is creating a large number of Repository Context's. I'm not sure if the way i'm using this is right or wrong, or what the common practice is. Details In the last 6 odd months, I've been making ASP.NET MVC applications that impliment...

Free docking controls that can be docked into third party app.

I have a application(not mine) that uses AxXtremeDockingPane by CodeJock to add dockable panels to the application. AxXtremeDockingPane has a method called AttachToWindow(int handle) which when called will create a docking manger into the window with the handle supplied, which can be any application. I was wondering if there are any ot...

Click and type (WinForms)

Hello All I was using an Adobe product (If I remember correctly, it was a PDF Creator) the other day, and they have this cool feature where you can literally click anywhere inside the window and just start typing. And the text will appear as you type, whereever you clicked. Can somebody please point me in the right direction where I ca...

Windows Aero-Glass (WinForms)

Hi All I have a Form on my Windows 7 pc and my form has the whole Aero Glass effect on the whole form. And I'm wanting to know if there's a way to draw text on the form that has glow effect, just like the text you see in the title-bars on vista and win7? Thank you ...

DataGridView auto size columns without showing the grid

I need to get DataGridView column sizes without showing the the grid (for printing). I'm using data binding through DataSource (using BindingSource doesn't seem to work too). For whatever reason I get wrong column sizes. If I show the grid in a form first, everything is fine. If I try to get column sizes after setting no DataSource and ...

Suggestions regarding the .NET tool to use for project

Hi, I need to develop a project that needs to have a Ticker and an AdRotator, apart from some button controls and a banner. I have two options - ASP.NET and Windows Forms. With Windows Forms, I've been able to develop the Ticker, but I don't know how to develop the AdRotator. With ASP.NET, I'll have to develop Ticker using AJAX, where...

how to add item in form2 - and see hem in ListView in Form1 ?

hi I have 2 forms, in form 2 i have button that adds Fname and Lname items, when i press this button . I want to see those items in ListView that is in Form1 thank's in advance ...

Clicking on a listbox means I can't click on anything else on the form.

I'm using a databound listbox in a C# WinForm application. When I click on an item in the listbox nothing else on the form works, even when I click on the close button the form doesn't close. Everything works fine until I select an item. What I have tried to do is in the listbox1_SelectedIndexChanged set the listbox1 focus to false b...

Custom Control and Scrolling, Help?

I can't get scrolling working in my custom control. Currently it draws it's own content (at the moment just grid) and should be treated as having a large area to work in. However, I can't get scrolling to work. With AutoScroll on, I can't get it to start of at the center of the workable area. With AutoScroll off, I can't get the valu...

C# application doesn't run on another computer

I complied my C# windows forms application on Visual Studio 2008 with configuration "Release". When I try to run it on another computer, no windows are shown at all. Complied on Windows 7, another computer has windows xp installed. What can it be? Added: I didn't create any installer. Another machine has .net framework 3.0, not 3.5 inst...

WinForms Web Browser control forcing refocus?

I'm trying to automate a web process where I need to click a button repeatedly. When my code "clicks" that button (an HtmlElement obtained from the WebBrowser control I have on my form) then it brings focus back to my application, more specifically the WebBrowser control. I wish to better automate this process so that the user can do oth...

How to get the explorer right click menu in Winforms ListView?

I am using a Winforms ListView to show some files, but other than showing the files like explorer does, I want to have the same explorer right click menu when you get when you right click an item inside. Is this possible? How do I enable it for my ListView app? ...

Custom draw Aero title bar without extending into client area

My WinForms application has the standard Aero glass appearance on Vista/Windows 7. I want to custom draw the window title bar so it retains the Aero glass appearance with the glass min/max/close buttons but without the title text and window icon. I have tried this by overriding WM_NCPAINT but overriding this event always causes the gla...

Using DwmExtendFrameIntoClientArea causes window to oddly resize

I have an application that uses DwmExtendFrameIntoClientArea to draw a glass effect area at the top of my .NET Form. A strange side effect is that when you maximize and restore the window it grows taller. So if you keep maximizing/restoring it just keeps getting taller! Remove the call to DwmExtendFrameIntoClientArea to remove that nice ...

Resizing Controls At runtime.

Hi All Does anybody know of any sample code laying around anywhere that would enable me to resize a picturebox at runtime when the mouse cursor is draging the bottom right edge of the control? Any help at all will be appreciated. Thank you ...

Making List view scroll in vertical direction

I am using a System.Windows.Forms.ListView with checkboxes = true I can see that when the list items are more than what can fit ,i get a horizontal scroll bar.I tried to find any Properties to change scroll bar orientation.Is there any way to make it scroll in vertical direction?Thanks in advance ...

Editable Label Controls

Hi All Does anybody know how I could go about creating an Editable Label Control? I need my users to be able to Edit Labels (Also change parts of its style info), but have found no helpful info anywhere online. Any help at all is appreciated Thank you ...