Все вопросы: [winforms]

4 365 вопросов

3
голосов
5ответов
1621 просмотров

Windows Forms Designer destroys form layout

This morning I stumbled over a weird issue in Visual Studio's Windows Forms designer. I have a form which worked for about a month now without changes. It looks like this in the application: (text made unreadable because I'm not entirely sure of the legal implications here). Now starting tod...

5
голосов
1ответов
2047 просмотров

Why do my Windows Forms strings look so ugly when anti-aliased?

I'm rendering some strings manually on top of a GraphicsBox, because you can't have a Label with a treansparent backdrop. No matter which rendering mode I try though, I can't get the strings to look any good (ie. as they would appear in Word or in a graphics program. Here's a picture of the int...

0
голосов
2ответов
3596 просмотров

Application Role connect to SQL Server with "Login Failed" error

I have a program which would use the Application Role to write data to a SQL Server 2005. using (SqlConnection sqlCon = new SqlConnection(connectionString)) { SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlCon; sqlCommand.CommandType = CommandType.Text; sqlComma...

1
голосов
2ответов
1175 просмотров

Hierarchical Gridview

I need to bind hierarchical List object to a Gridview (Hierarchical in windows form). How can this be achieved - any examples ?? Ex: of list object List of CargoMovement => Cargomovents and each CargoMovement has List of Transactions thanks for help

0
голосов
1ответов
273 просмотров

Listview filling issue

I need to know what are the things going on here.Actually my aim is to add a column additionally and display the contents.I Added column but i want to know the codeflow required to finish to display items in that column ManagedDeviceCollection list = new ManagedDeviceCollection(); try { if(S...

8
голосов
3ответов
8990 просмотров

Adding a custom context menu item to Windows Form title bar

I found a thread on MSDN that shows how to add an item to the context menu of a winform title bar. Unfortunately it does not show how to register an event with the custom menu item and I have been unable to figure out how to do it. Below is a sample app that can be copied and pasted into a new Wi...

0
голосов
5ответов
819 просмотров

Multithreading on Windows Forms

I want to paralelize a 3D voxel editor built on top of Windows Forms, it uses a raycaster to render so dividing the screen and getting each thread on a pool to render a part of it should be trivial. The problem arises in that Windows Forms' thread must run as STA - I can get other threads to sta...

1
голосов
4ответов
579 просмотров

How can I write a Google Wave rich client?

I am not sure my question makes any sense. Google Wave is using HTML 5 and such. But if I have a desktop (say winforms) application, can I leverage google Wave for collaboration/discussion? Does it even make sense? If so, what's the API?

3
голосов
1ответов
895 просмотров

Running winforms in task bar

I have a winforms application that I want to display an icon, and display the icon next to the icons on my taksbar for like my AV sofware, and the volume control. Any idea how to do this? Thanks in advance.

1
голосов
1ответов
5214 просмотров

C# Dynamically add ToolStripMenueItems to MenuStrip

I was wondering if SO could help simplify some logic. I have a windows form (C# 2.0) which contains a System.Windows.Forms.MenuStrip. I want to dynamically add ToolStripMenueItems to the MenuStrip. The added items will be driven off of a database (but for simplicity I have removed that part...

3
голосов
2ответов
1501 просмотров

WinForms Dynamic Localization

We have CAB (Composite Application Block) based smart client winform application. One of our software requirement is to replacing the text dynamically when the user change the language option provided in our application. We support around 6 languages including east-asian(Chinese/Japanese), Eur...

0
голосов
1ответов
391 просмотров

How would you work with "MDI-ness" in an application that wants to use the MVP pattern?

The situation: MainForm (assigned to the MainPresenter) is up and running. The user click a ShowFoo button - an event is passed to the MainPresenter which in turn creates new FooPresenter and the FooView. How should I proceed now ? Where should the presenter be created and where should the view b...

9
голосов
6ответов
17634 просмотров

Create a file in the userfiles folder (C#, Windows Forms)

I'm trying to create a text file in my Windows Forms application. It is working fine, but it is creating the text file in the application's default location (like in folder bin). But I want to save that created text file in my user files folder. How can I do it? This is my code: FileInfo fileus...

25
голосов
7ответов
151146 просмотров

To show a new Form on click of a button in C#

I am new to C# can anybody tell me on How to show a new Form on click of a button.

0
голосов
6ответов
676 просмотров

String extraction in c# winforms

I've an xml file like this <div class="details"> <a href="/Details/Empinfo.asp?empid=134">Employee details</a> </div> now i want to get the empid (i.e 134) from the given xml file in c# winforms. Can somebody help me how to get the emp id Thanks in advance

4
голосов
1ответов
1632 просмотров

Is it possible to get your user control to display those alignment guides when placing them on a WinForm?

In Visual Studio (2008) when you place a textbox on a Windows Form, and drag it around, you see very helpful guidelines which help you align it (left, right, top or bottom) to other controls. You also see a line the represents the bottom of the text in that control helping you align the text with...

3
голосов
2ответов
4162 просмотров

DateTimePicker ValueChanged event fires the first time when there is no change

Winforms 2.0. Stick a DateTimePicker on a form. It defaults to TODAY. Click on the dropdown arrow to show the Calendar, and click on TODAY. The ValueChanged event DOES FIRE, even though it is already set to today. What i would like to do is replicate this same functionality - I would like to res...

5
голосов
3ответов
4872 просмотров

How to make an ownerdraw Trackbar in WinForms

I'm trying to make a trackbar with a custom graphic for the slider thumb. I have started out with the following code: namespace testapp { partial class MyTrackBar : System.Windows.Forms.TrackBar { public MyTrackBar() { InitializeComponent(); } ...

3
голосов
1ответов
9875 просмотров

how to programatically edit the cell value of a datagridview in virtual mode?

I have a DataGridView in virtual mode. I only implemented the CellValueNeeded eventhandler as described in http://msdn.microsoft.com/en-us/library/15a31akc.aspx. Implementing the rest of the events only seems needed when you want to be able to edit the cells manually. I would like to programati...

0
голосов
3ответов
2051 просмотров

Application using multiple windows forms

I am (still) writing a small application which requires me to use several windows forms to show to the user. Some of the forms just show progress messages while the application performs tests using several external devices. The forms will usually be used in order (see below) but there may be so...

0
голосов
2ответов
150 просмотров

Not sure how to get the 'final' output from a WinForm KeyPress event

I've got a simple winform. In it has a single TextBox control. In that, i've wired up the KeyPress event. Why? I'm trying to capture everything the user types in that textbox. But, when they hit return or enter, i then grab everything they've typed and send it to a command parser to do stuff. I ...

7
голосов
4ответов
4760 просмотров

How can I make a part of the form partially transparent in C#?

I want to make a part of a form semi-transparent, with additional text on that part which is not transparent. How can I accomplish this in C#?

14
голосов
6ответов
20742 просмотров

Stopping TextBox flicker during update

My WinForms application has a TextBox that I'm using as a log file. I'm appending text without the form flickering using TextBox.AppendText(string);, however when I try to purge old text (as the control's .Text property reaches the .MaxLength limit), I get awful flicker. The code I'm using is a...

3
голосов
6ответов
2574 просмотров

ToolStripButton text gets cut off in ContextMenuStrip

I am instantiating my own ToolStripButton and adding it to a ContextMenuStrip. It pops up but the text gets cut off: string[] layouts = new string[]{"Test 1", "Test 2", "Test 3"}; List<ToolStripButton> items = new List<ToolStripButton>(); foreach (string layout in layouts) { Tool...

2
голосов
2ответов
5024 просмотров

c# checked listbox MouseMove vs MouseHover event handler

I am using the following MouseMove event-handler to show the text-file content as a tooltip on CheckedListBox and there is a text-file object tagged to each checkedListBoxItem. private void checkedListBox1_MouseMove(object sender, MouseEventArgs e) { int itemIndex = checkedLi...

15
голосов
8ответов
45311 просмотров

how to show contextmenustrip when a button is clicked in the right position

I want to click on a button and have it show a ContextMenuStrip right below the button. It keeps showing up in the left hand side of the screen when i try PointToScreen and top and left coordinates. Any suggestions?

1
голосов
3ответов
541 просмотров

trying to determine best user interface for layouts - winform button that shows dropdown

I am adding layout management to my winforms GUI which really just means that you can "Save" the current column settings with a "Key" so for example you can have "View 1" or "View 2". anyway, i dont have much real estate on the screen but i am trying to figure out the best way to: Allow you t...

11
голосов
4ответов
2179 просмотров

OutOfMemory, but no gcroots for many objects

We are developing a rather large Windows Forms application. In several customers' computers it often crashes with OutOfMemory exception. After obtaining full memory dump of the application moments after the exception (clrdump invoked from UnhandledException handler) I analyzed it with ".NET Memor...

0
голосов
5ответов
795 просмотров

Generic method to get a control name when moused over?

I am writing an application that I am working on a skinning feature to it. What I want to do is allow a user to create an XML document that my code will parse through and set properties of the controls on a form. This is the easy part. Where I am stuck is giving the user a way to find out the ...

2
голосов
1ответов
3752 просмотров

Enable full find-as-you-type combo box in WinForms?

The Windows Forms ComboBox control only offers partial find-as-you-type functionality - it only searches for the first letter. For example if you type "c" and "a", don't expect "California" to become selected - instead you'll land on a state starting with "a". Somehow, perhaps through Firefox, I...