winforms

Show Right Click Options on the Selected List View Record Only - Winforms C#.NET

The ContextMenuStrip tied to the ListView control. However, the right click option (edit) appear where ever i click on the ListView area, this gives me exceptional error because the implementation of edit can only cope with a selected row. I only want it to appear when on a selected row (blue highlighted row). How can i do it? ...

Embed office (Word Excell) into WinForms or WPF controll

Hello, Is it possible to embed Office application in WinForms controll (having office installed on computer) ? Thanks for help ...

changing properties of wcl in c sharp

hi folks, i am using windows control library and plugged in a textbox,label,button and called it check_my_id althought the control gets placed on the form. i am not able to change the properties of label, button , thanx in advance ...

Close child form if already open

Hi All How can I go about closing a Child form if it's already open? And if it isn't already open, then open it? Thank you I already have this code, which doesn't work, obviously: Form ibx = new inbox(); if(ibx.Visible) ibx.Dispose(); else ibx.Show(); All that the above does is creates a new form whether or not it's already open. ...

Winforms, databinding, Listbox and textbox

Hi dear friends, I have a ListBox (MyListBox) on my screen, and a Textbox (MyTextBox). The ListBox is filled with a List(Of T), which are all custom items. Now I try to do this: The ListBox' datasource is the List(Of T). Now when an Item changes I want the textbox to be updated to a particular property of the selected item in my Li...

Handle tab key in ToolStripComboBox

Hi, I have a ToolStripComboBox in a ToolStrip, and when I press TAB key in it, it gives focus to the next toolstrip button. I would like to change this behavior and give focus to a richtextbox on my form instead. The problem is that ToolStripComboBox does not have PreviewKeyDown event. And PreviewKeyDown of the hosting ToolStrip Toolba...

How to return string from a button click handler?

I need to return a string from a button method .How can i do that? private string folderPathButton_Click(object sender, EventArgs e) { FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); folderBrowser.ShowDialog(); string folderPath = folderBrowser.SelectedPath; return folderPath; ...

How to use Windows Authentication in Windows Application?

How to use windows authentication (local machine administrator user) in windows application written in c#. Need is whenever user opens my windows application GUI, it should authenticate local administrator credentials even if User is logged in as Administrator there. Please help. Is this windows Impersonation? ...

C# how can I make a listbox drowdown like a combobox does?

How can I make a listbox dropdown like a combobox. Or is it possible to configure a combobox so that the user can't add values but rather only select from the available list of values. This is for a desktop application. Thanks ...

How to write content in a text file at the end of each line

Hi, I am having one text file which contain following kind of data. "3P","Smith","Richard","3 Point Promotions","3P","[email protected]","IDA","Yes",,,,0,4,5,83.33,10, "A1","Ernest","Amy","TAKE 1 Promotional Products","LCOOK","[email protected]","IDA","Yes",,,,0,6,7,,0, "A2","Derek","Eaton","Advertising Edge Promotions","AE","derek...

C# Adding Items To A Windows Form

I built a little console application in C# and need to add a windows form interface to it. I added a form item, and now have a blank form. I don't know how to go from here and start adding buttons and menus to the form. Is there a form design toolbar or do I have to add buttons and menus using code? ...

C# Console Keeps On Popping Up On Form Application

When I run the following code, I want just my form to show up and not the console. How can I get this to work this way? namespace NameSpace1 { public class Program { [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRender...

Combobox how to get the selected item to show a theme

I'm doing a tic tac toe game and I am trying to add a combo box that will change the applications background based on what the person selects right now I have summer, spring, fall, winter and the images are in the bin/debug folder how can I get this to work I don't know where to start and the tutorials are a bit confusing. Could you ple...

C# Windows Form: On Close Do [Process]

How can I get my windows form to do something when it is closed. ...

C# Combobox (winforms) how can I make the values appear as percentage

Hello I've got a combo box with a set of values( 5, 10,15, 20). When the user goes to select a value I want them to appear as percentages (5%, 10%, 15%, 20%). I was playing with formatstring using a value of ##% but that did not work. ...

My.Settings not saving after install

My application is not saving users settings after I install it. When I test my app in debug or release mode it works fine. However after compiling, linking and installing the My.Settings.Save() does not seem to be working. I can manually change a setting in the config file and the app runs accordingly. So I know it’s reading the config ...

Windows Form Custome Tool: Combobox with Checkbox items

I need a control that acts like a combobox but has checkbox items in it. I don't see any tool like this. What's the best way to 'roll your own'? ...

How do I load SciLexer.dll in Visual Studio 2008 Designer, on Windows 7 64-bit?

We develop a WinForm application using Scintilla.NET (1.7) component, which uses SciLexer.dll (unamnaged). At run-time, we distribute both 32bit and 64bit SciLexer.dll, and we load the correct one when the application starts (everything works fine). On our new development environments (Windows 7 64-bit), all our solutions build and run ...

How do WinForms controls inside WPF WindowsFormsHost remote?

Say, I have a WPF program with a Windows Forms control in "WindowsFormsHost" on some of its windows. I use that program via Remote Desktop. How will this control's graphics remote? Via GDI instructions as if it was WinForms app or as plain bitmaps like WPF does? ...

Current ways to do data binding in .NET 3.5 with C# 3.0 and WinForms

Hello Everyone, I have an existing C# 3.0 WinForms project with .NET 3.5 that talks to a MySQL database. I would like to use data binding (I'm new to this, so I've been doing all of the UI updates manually) to simplify things. I followed a link from this question to this article which mentions using a DataSet but also follows up with ...