winforms

Tracking activity in a WebBrowser control from a Windows Form Host

Disclaimer: I'm asking on behalf of a client, and have not witnessed this issue first hand. He has a third party app that produces training media, which his training application presents in a WinForms app through the WebBrowser control. The interfaces he has been able to access on the WebBrowser control, on the surface of things, don'...

Printing from my .net app and the colors are wrong.

I am printing a custom generated image to 2 different color printers and the colors are off. If I save that same image out to a png, it looks fine and even prints fine via the photo viewer. I have set the PageSettings.PrinterResolution to the PrinterResolution on the PrinterSettings with a kind of "High" and nothing. Thanks. [EDIT] also...

KeyDown event not firing with .NET WinForms?

I already have KeyPreview set to true in the form properties I'm working on a small program, and I'm having a problem where it seems that some of the controls on it inside groupboxes are not triggering the KeyDown event on my form when I press and release any arrow key, just the KeyUp event. Is there something wrong with my code that m...

Set visibility on single tab in tabcontrol (winforms)

Is there a way to set the visibility of a single tab in a tabcontrol? I thought something simple like this should work, but does not seem to to anything. tabControl1.TabPages[1].Visible = false; tabControl1.Refresh(); There will be a main tab that always shows but I want to have other tabs that I can "turn on\off". I don't want to...

looking for a month/year selector control for .net winform

I am looking for a month selector control for a .net 2 winform. ...

is there a way to set the days and month names manually in a winform datetimepicker?

hello I want to set the days of a datetimepicker in english but unfortunatly, the datetime picker don't support culture so I think I can inherit the control, and set the days and months name by myself but I don't know how anybody has an idea for that ? thanks in advance Sam ...

How to clear graphics on a transparent control in windows forms

So, I am pretty unfamiliar with windows forms development. I'm trying to create a "hey I'm busy doing stuff" component that just spins a shape around. I want this control to be transient and draw on top of any other controls. The class inherits directly from Control. So I have this in the constructor: SetStyle(ControlStyles.Opaque, tr...

Visual studio like panels

Hello, I need to make some vertical docking/collapsible panels in the style of the Visual Studio IDE (like Solution explorer, Toolbox, Properties, etc...), does anyone know some examples or code for doing that? Thanks, R. ...

C# Winform; Possible? ComboBox with 2 DataSources, Diffrentiated by Colored text

Can a c# combobox have two datasources diffrentiated by sorting (Source 1 entries at the top) and Text color (Source 1 entries colored blue for instance)? ...

how to Decrypt Application settings before binding?

hi all, I am using Application settings in my c# project to save gmail username and password. Before saving the settings I am encrypting the plain text password. When I am restarting the app retrieving them is of course without any problem but the retrieved password is encrypted. What I want is to decrypt it back before binding back t...

Any easy way to use Custom ScrollBars on a .Net Control

I have a UserControl and I want to make custom scrolling. Can I use the already built in Horizontal and Vertical ScrollBars without setting the AutoScroll flag to true? I can Enable and define min and max value for both ScrollBars and I can see them on my control, but when clicking the buttons they don't move and in the scroll events I d...

Does Winforms DataBinding work for programmically changed properties?

I have some UI controls that are using DataBindings.Add method, and it works if I change the specified UI property by hand, or the source object is changed outside. But if I invoke the UI.Property = value in code, then it doesn't change the UI nor the source object that's specified for DataBindings.Add. What am I doing wrong? Am I usin...

C# Binding Generic LIst<string> to Combo Box

I have a combo box and I want to bind a generic List to it. Can anyone see why the code below won't work? The binding source has data in it but it won't fill the combo box data source. FillCbxProject(DownloadData Down) { BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = Down.ProjectList; cbxProjectd.D...

How to simulate a web browser so the website feeds me the correct HTML source?

I'm trying to webscrape a website and it appears to be feeding me bogus HTML with the WebClient.DownloadData() method. Is there a way for me to "fool" the website that I'm a browser of sorts? Edit: Adding this header still doesn't fix the issue: Client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET...

How can I access a WebBrowser control from within a UserControl?

I have this layout: A UserControl inside a Panel. Panel is inside Form1. WebBrowser is in another panel that is inside of Form1 as well. So: Form1 Panel1 Panel2 MyUserControl TheWebBrowser How could I set the URL for my webbrowser in Panel2, from withing MyUserControl? I've tried something l...

Lock in properties, good approach?

Hi, In my multithreading application I am using some variables that can be altered by many instances in the same time. It is weird but it has worked fine without any problem..but of course I need to make it thread-safe. I am just beginning with locks so I would appretiate your advice: When client connects, class Client is created where ...

C# Transparent Form in Panel

Hi there, im trying to create a semi-transparent form which is displayed in a panel. i can display the form in the panel but the opacity property wont work and the form is non-transparent. private void button1_Click(object sender, EventArgs e) { Form fr = new Form(); fr.FormBorderStyle = FormBorderStyle.None; fr.BackCo...

Windows forms: ShowDialog - dialog doesn't show up

I am running an external process from an outlook plugin - and it doesn't show the dialog. I am using ShowDialog without parameters. Any ideas how to show the dialog ? The process doesn't have any form - i just want to show a dialog with some selections. If I call "MessageBox.Show" before, the dialog is shown - otherwise not. I guess ...

C# DataGridView MouseClick + CTRL not calling CellClick() EventHandler

Hi! I'm using WinForms and a DataGridView. I've register an CellClick event for selecting/unselecting 1 item (project name). The problem is that with CTRL button hold down + Mouseclick this Event is not fired. This is my EventHandler: private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { ...

Action required to do the operation "browse"

If i created a button named Browse ,,If i click Browse button i have to browse my system folders .Can any one give me the required code to browse the specific folders ...