winforms

WinForms - Programmatically adding lots of controls to a Panel at runtime

I need to be able to add several hundred instances of a custom control (UserControl) to a panel at once. When I do this using Controls.AddRange(), it hangs for a very long time. Is there something I need to do that will decrease the amount of time this takes? ...

WinForms - Custom XML Editor

I've created a small HTML/JavaScript based mini-web app that reads data from an XML file. Now, I need to create an offline WinForms editor for this XML file. I'm fully aware that using an XML file to store data in the fashion that I do is far from ideal, but the requirements are such that I can only use static files for the web site, th...

newbie to OO question

My question pertains to windows forms Let's say I have a combobox for customer and orders, and depending on the selection made on those comboboxes I populate a datagrid for all the Order details. I am interested in a double click event within the datagrid row. Upon the event 2 things can happen: the record was deleted. one or both ...

Why won't these combo boxes update correctly when changing datasource in Windows Forms (VB) ?

In a windows forms project, I have several combo boxes. The first combo box contains a list of objects. Those objects then have several lists which are used as the datasource's for the successive combo boxes, depending on which item is chosen in the first. When the first item is selected, the other combo boxes update correctly. When thi...

Handle Button Click in WinForm DataRepeater C# Power Pack

hi, i want to handle winform button click in the DataRepeater, how can i do it? all button are placed in a DataRepeater Thank you very much ...

Mono Winforms Problem

Hey , does anyone know why a winform application in windows, reaches via the ending program flow , to the point : this.close (of the main form) , closes the application normaly in windows , but in Mono the windows get stucked... ? ...

How to read the Color of a Screen Pixel

Okay, I am looking for a function or something that will read the color of a certain pixel on my monitor, and when that color is detected, another function will be enabled. I figure using RGB. All help appreciated. Thank You. ...

Interacting with a form without it activating

Hello. I'm trying to implement code-completion popup window in my project. The window is derived from Form. It contains two controls: custom list derived from UserControl (it shows completion possibilities with icons) and a VScrollBar. When the popup appears, it doesn't steal focus from the editor (form's ShowWithoutActivation is overri...

Hiding dashed outline around trackbar control when selected

Hello, In C# winforms, is there a way to not show the dashed focus outline border that shows around a trackbar control when it is being used? Details: This outline looks kinda tacky to me, so I'm just shooting for aesthetics to not show it. Thanks, Adam ...

Howto draw "pages" in a C# WinForms project

Hi, I want to display data on a Windows Forms project in C#. The general sketch for the GUI is similar to Acrobat Reader or MS Word - meaning i want to display the data on several pages, and let the user navigate between the pages. The data i`m displaying isn't special, i just want to give the user a "page" feeling when viewing it. I...

WinForms floating windows (like Delphi7 IDE)

I want to setup my WinForm to look like the Delphi7 IDE. Basically that means the window has no background (the desktop shows through), and child windows float around. Here's a sample image: I can handle the floating windows, but how would I go for the main window (the menu bar and the toolbar)? What are the WinForm properties require...

Is there a way to render SVG in winforms?

I am working with a library that renders part of its state as an SVG document. I would like to render this in either a Winforms or a WPF environment. Is there currently a way to do this? If not, I could modify the library to use a more general rendering strategy, and then add an XML adapter to restore the original functionality, but t...

How to make a windows form to come front in windows application done in c# ?

I have done a global mouse event in my windows application. When i click the center button of my mouse, i want to make a particular form topmost... There are some applications which runs in the full screen mode, so i need to do this, in order to make my form visible to the users, because this is the only way to view it. Since Alt + Tab...

How to highlight text in Pdf Winforms C#

I have a pdf file which I want to open in a Windows Forms Application and perform following tasks- View the pdf document Zoom +/- document Search Text Highlight a specific text Show it in a listbox/dropdown select those words and highlight in pdf Remove selection/Highlight. I have tried using certain libraries like pdfSharp/iTextShar...

winform c# : insert another form control after an event in c#

what i want to do is actually more complex than this. but the principal is this.. i want to insert another control like text box into an existing form, but after some event like a click of a button. the new text box would be inserted into the same form( main form) what i have got is. i created as usual windows form application, and t...

flip coordinates when drawing to control

I am drawing a graph on a control, but 0,0 is at the top-left hand corner of the control. Is there a way to flip the coordinates so that 0,0 is at the lower left corner of the control? ...

Error: Cross thread operation not valid

I am trying to access a form from a different thread to that on which the form was created, and finally ended up with an error: Cross thread operation not valid public static void MakeTopMost(Form form) { SetWindowPos(form.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS); } I am passing a form which is running in another thread. ...

Event subscription to a static instance. How to ensure GC.

Hi. I'm fixing a User control component using the .NET 1.1 framework. There are many instances of this user control referencing a singleton wrapping a COM resource. They subscribe to events from this resource. I suspect that the reason why we are having a degrading performance is because the singleton is maintaining a reference to t...

PathGradientBrush and Graphics.DrawArc

I'm overriding OnPaint for a panel and drawing a circle with a radius slightly less than the shortest side of the panel. The radius changes when the panel resizes. The circle is rendered with Graphics.DrawArc, using a pen with a thickness of 10.0f. This works fine when I use a solid color for my pen. However, I would like to give the...

Automatically resize TableLayoutPanel

I have a programmatically created TableLayoutPanel. It works fine but I couldn't find something: how can I make it size columns automatically when the form is resized? The panel is set to Dock.Top and when I resize the form instead of sizing every column as percents, only last column grows. What can I do for this? Here's how I add Column...