winforms

ActiveX control going blank in one host container but not others

I need to use activeX to create a plugin for a legacy application. I'm using C# so that i can share the codebase of several related stand alone products. When I host the control in the SDK's test container (TstCon32.exe) everything works fine. The problem is that when I try to load it in the target application the first time I click...

Console.Write is not working when executed by BackgroundWorker of .NET GUI Application

I've a (C#).NET GUI application. Where I need console for displaying some output. The code that (is writing to console) contains Console.WriteLine statements is executed by the BackgroundWorker & not the main thread. Some one suggested,here: http://stackoverflow.com/questions/3385097/console-write-in-net-gui-application/3385142 that mak...

How to use UserControl in Window forms programming C#

I'm studying UserControl in c#. Can you guys please post your recommended website for tutorial for this topic? (for beginners esp.) Thanks : ) ...

N-Tier with C# ?

I am looking at writing a WinForms app and getting stumped over what seems to be simple issue. There is a server and database (SQL Server) Open ports are HTTP, HTTPS There is a WinForms client. It needs to connect a TCP/IP stream (possibly HTTP, SOAP, REST) to the server. Sometimes the WinForms client goes off-line and then the WinFor...

Keep a ToolStripDropDownButton dropped down for multiple selections

I have a ToolStripDropDownButton that has multiple children and I'm using them as checkboxes (CheckOnClick=True) so you can check multiple child items. My question is: how do I keep the parent item "dropped down" so it doesn't close up every time you click a child item? ...

Good resources for Winforms development

What are some good resources for winforms development? For example, when you have to have a bunch of different controls and event handlers on one form. Do you use partial classes, user controls, special attributes,...? How do you handle communication between user controls - only with events? Are there any patterns you can use? ...

how to compress & fix database access 2007 by C# code ?

hi my C# winforms program work's on database access 2007 this database became swollen. is there any way for compress and fix this database by C# code ? if i do it manual (through access) it became less swollen thank's in advance ...

MouseLeave event fires when moving over control's ScrollBar

I am reposting this question due to inability to solve the problem (original here). In the TreeView, ListBox, or it seems from my google searches anything with a ScrollBar, the ScrollBar is not considered a part of the control. I have a TreeView that I'm putting into a custom control, and it's Dock Fill. So there it acts as a custom Tr...

preserve form's aspect ratio upon resize in c#

How can I make a form have a fixed aspect ratio that is preserved when it is resized? I know it can be done by overriding OnSizeChanged and manually modifying the [new] Height/Width, but that causes flicker since it is resized once before the event is called (to a size not matching the aspect ratio) and then resized again (to the correc...

Why doesn't AutoScrollMinSize take effect until I mouseover?

I have a panel and I set AutoScrollMinSize. I also call Invalidate() on the panel in order to force a paint. The size of the panel is less than the size of the AutoScrollMinSize values, yet the control does not display the scroll bars until I mouse over the panel. What would cause this behavior, or how can I have the AutoScrollMinSize...

Separating visual attributes from data classes?

I'm trying to figure out the right way to do this. I have a WinForms app that is using a PropertyGrid as one of the controls; I'm using the .SelectedObject property to assign the appropriate object to display attributes for. The PropertyGrid uses declared attributes against this object's class properties to determine visual things, e....

Problems with keys on winform and focus

My winform window was working fine then i added a combobox to it. Now my code which uses theform_KeyDown does not work. From my understanding when it gets focus it gives it to my combobox thus my window keydown event never happens? I had pictureboxes and no matter where i clicked i was able to use the keys nicely. How do i allow keys to...

Building a DataTable to a custom control

Are there any tutorials around for how one would go about creating a control that can be bound to a DataSet? I can't seem to find anything much about it on Google. I've tried this, where my control has a DataRowCollection property called Items (and a dataset called ds, containing a single table): ctrl.DataBindings.Add("Items", ds.Table...

Is there any control drivelistbox in Dot Net ?

Hi, Is there any control drivelistbox in Dot Net ? I have seen this control in VB6 but not in dot net ? ...

is there any way to hide list view Item in .net 2.0

is there any way to hide list view Item in ListView ? ...

High-Performance UI Framework for .NET

My current task is to develop a software for measurement and testing purposes which will communicate with various devices. Because i have to assume that there will be a high amount of data transferred from the devices that needs to be displayed in some plotting component or similar, the UI framework used should be as fast and responsive ...

how to compress access file - but without see access on the screen ?

hi i have this for compress my database file - access 2007 System.Diagnostics.Process.Start(@"C:\Program Files\Microsoft Office\Office12\msaccess.exe",@"c:\Mydb.mdb /compact "); how to do it without see access on the screen ? thank's in advance ...

Databinding, subdatabinding in Windows.Forms

Hi all, Consider a serviceCall which returns an object: // the int is the ID! Dictionary<int, Dictionary<MyObject, List<AnotherObject>>> theData = Service.GetData(); MyObject looks like this: class MyObject { public string Name { get;set;} } I have 2 comboboxes. Combobox1 : I want to display the int from the dictionary. So ...

how to disconnection access in my C# program ?

hi I tried to compress my Access 2007 database like this: System.Diagnostics.Process.Start(@"C:\Program Files\Microsoft Office\Office12\msaccess.exe",@"c:\Mydb.mdb /compact "); In my C# program and I get this error: You attempted to open a database that is already opened exclusively by user on machine . Try again when the datab...

How to manipulate at runtime the invocation list of a Delegate?

Hi Guys, I want to know how do I go about removing individual delegates from the invocation list of the parent delegate. <DelegateName>.RemoveAll(); Now I can just remove all and that will work just to get the idea in motion and see if works which it should but then any delegates removed will need adding again at RunTime!!! so: ... ...