winforms

Drawing, and Appending to a Double-Horizontal Line

Hello, I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just ...

file drag and drop event in win forms

Guys, Is there a way to tap windows file drag and drop events using WndProc() ?. I want to tap file drag and drops from one folder to another in WndProc. Thanks ...

C# - Cannot find NavigateToString() method

Hi, I've heard nice stuff about the NavigateToString() C# method, but i can't seem to be able to use it =( I have a System.Windows.Forms.WebBrowser in a panel, and when i try to call NavigateToString() it says: "Error: 'System.Windows.Forms.WebBrowser' does not contain a definition for 'NavigateToString' and no extension method 'Nav...

Reference to connectionstring in settings

This is for a Windows Application. In a class I want to referee to my connectionstring called freighthelper which is located in the settings.settings file in my project. How do I do this? I have tried with this without success. _connection.ConnectionString = FreightHelper.Properties.Settings.Default.freighthelper; ...

How to set the CTRL + R in Windows button

I have the below code where I am expecting that when the user will press the CTRL +R , the program will be trigger public Form1() { InitializeComponent(); button1.KeyPress +=new KeyPressEventHandler(button1_KeyPress); } private void button1_KeyPress(object sender, KeyPressEventArgs e) { if ((e.KeyChar == (char)Keys.Control...

Editing WinForms RichTextBoxControl C#

How can you add text to a RichTextBox control and change the font style as you add text? ...

forms.timer not triggering the function on form load function

I have following code in the form_Load function System.Windows.Forms.Timer newtimer = new Timer(); newtimer.Tick += new EventHandler(refreshinfo); newtimer.Start(); newtimer.Interval = 20000; The "refreshinfo" function goes like this: private void refreshinfo(object source,EventArgs e) { // Some code here } The function "ref...

[C#] Possible to loop through a list of variables, with names differ by numbers only?

For example in Windows Form, you have textboxes textbox0 to textbox29 and you need to assign them all to an array. What I currently can think of is to do this: array[0] = textbox0; array[1] = textbox1; ... array[29] = textbox29; Is it possile for me to do sth like this: for(int i=0; i<30; i++) { array[i] = textbox + i; //and so...

Writing embedded javascript code to c# .net

i have the js file how can i add that in winform C#, i have developed the front-end and i want to run the js file on button click. i will be thankful to u if u provide the snippet!!!!! I want to run javascript code in windows form thank you. ...

Changing autogenerated code in a C# Windows Forms Application project

When you open a new C# Windows Forms Application project in Visual Studio 2008, you get a lot of autogenerated code (AssemblyInfo.cs, Resources.Designer.cs, Settings.Designer.cs, Form1.Designer.cs, Form1.resx, Program.cs). Beside adding components from the Toolbox to Form1.cs[Design] and code to Form1.cs, what files can you change? And ...

Need to activate a window

I have a situation like this. I have the window handle of an application. I need to activate it. I tried all these functions but is not working always.(most of the time , it doesn't work the first time and I'll have to manually click on it to activate it. Second attempt onwards it works fine) The reason why I am doing this is because I ...

Subscribe to event of changing time on local system

Is there a way to my C# winforms application knows when Date and time settings has changed on local computer. ...

Runtime error in string builder which was declared static

My code to insert data is as follows it works for the first time if i tried to insert data for the second time i am getting the error My complete code using System; using System.Collections.Generic; using System.Text; using System.IO; namespace ACHDAL { public class EntryDetail { int[] debits ={ 25, 26, 27, 28, 29, 35, 36, 37, 3...

To get the Form from its Processhandle

Is there any way to get the Form from its Processhandle ? Some thing like this. Form form = (Form)Form.FromHandle(_process.MainWindowHandle); But this is not working. Thanks in advance ...

Adding own event handler in front of other event handlers

When I utilize AddHandler in VB to add my own method to the Click event : AddHandler Button.Click, AddressOf myButton_Click I see that my code executes last - after other event handlers for the Button_Click event. Is there a way to insert my event handler in front of other events so that it executes first? I tagged this questio...

Combobox appearance

Can I change the appearance of a Winforms ComboBox so that a Combobox with DropDownStyle = DropDownList looks more like one that is DropDownStyle = DropDown. The functional difference between them is that the former doesn't allow for user entered values, the problem is that it's default color scheme looks grayed out and doesn't match wi...

ctrl ctrl hotkey for my application

I have an .net C# winforms application, and I need to add hotkey support, but I want more than the standard RegisterHotKey function, I want be able to support hotkeys like ctrl-ctrl (like in Google Desktop). Please provide me a direction how to implement this. edit: You didn't got it right. I want the hotkey to work even if my applica...

How to make a WPF TextBox use password characters?

hi, i need to set it it dynamicaliy.. Can i make password Box to as normal text- i mean- user could see the text what he entered.??? its for-> i need to use same control for " password sesion" and also the "item count entering" session ..?? ...

DataGridView Row select without RowHeaders

How do you select the whole DataGridView row on cell select and disabling the selection of a single cell NOTE: just like the behavior of a listview ...

Referer spoofing using an WebBrowser Control in .Net C#

Hi, We are developping a software in c# (WinForm) that use a WebBrowser Control. We would like to spoof referer but it seems very hard to do it well. What we did : We just add "Referer: http://www.ourwebsite.com" in the http header when we use WebBrowser.Navigate(URL, null, null, REFERER); Result : Using this method, on URL, we can de...