winforms

Implementing an OpenFileDialog with sound file preview.

I would like to implement an open file dialog or file browser that additionally offers a "Preview" button to play the currently selected sound file (wave format in particular, other formats are not necessary for this application). I could create my own form with various controls such as a treeview and listbox to show the folders and fi...

Win.Forms project structure guidelines

How do you typically organize Windows Application project files and what naming guidelines you follow? For example, usually I keep project root folder as clean as possible with program.cs, app.config. All the others files are put into project folders: UI folder for all UI components: UI\Base (base forms and base user controls) UI\...

event name in sharpdevelop

Hi all, i want to ask abt Sharpdevelop. Can i change the control's event name in sharpdevelop ? I want to add "_" like in visual studio. For Example, button click event in Sharp develop defaulted to Button1Click. can i change to Button1_Click like in visualstudio ? Thanks. ...

Adding a DataGridView in IronPython Studio Winforms gets a "'DataGridView' object has no attribute 'BeginInit'"

By just adding a datagridview in IronPython Studio it triggers a "DataGridView' object has no attribute 'BeginInit'". Is there a fix for this? The errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are deleted, but that's not what it should be done to fix that ...

Winforms - Datagridview, disable button/row

Hi folks, I have a datagridview on a form with some data. The 1st column contains button for deleting the row. How can we disable this button or the entire row based on some condition, so the row cannot be deleted? TIA ...

Attribute to specify display format of a property or field

I currently already decorate properties in my business objects with attributes related to validation in Windows Forms. I would like to add attributes that would determine how the data is formatted. This would hopefully work seamlessly with data binding. Is there a way to do this? ...

How do I launch .net windows forms application with no visible windows?

I have a .net windows forms application that needs to open directly to the notify icon (system tray) with no visible windows. I realize that I can do this in the onshown event or something like it. But if I do that I get a flash of the window. How can I avoid that flash? I have tried modifying my Program.cs file to look like this: A...

Non-english alpha-numerics in a text file

C# WinForm application EDIT: It appears there's concern about foreign language compatibility. This is a non-issue. The card game I'm making this utility for is primarily in English. In the future I may support other languages, but everything will still be keyed off the English names, which are a primary key in both the program and the...

Directory file size calculation - how to make it faster?

Using C#, I am finding the total size of a directory. The logic is this way : Get the files inside the folder. Sum up the total size. Find if there are sub directories. Then do a recursive search. I tried one another way to do this too : Using FSO (obj.GetFolder(path).Size). There's not much of difference in time in both these approache...

Need idea to create the dynamic menu strip in windows application using data table.

Menu style: File . Tool -file1 -tool1 -file2 -tool2 -file3 -tool3 datable contains the rows like. col1 col2 ------------ File file1 File file2 File file3 Tool tool1 Tool tool2 Tool tool3 How to bind my data table value into menu strip dynamically i get my data table values from database dynamically. Based on my...

window form: Adding Emoticons

Hi, i am trying to develop a window form chat application using c# with asp.net 3.5 framework. in that form i want to insert emoticons as we found in yahoo, hotmail etc messenger. can anyone tell me how i can implement that thing as it is done in messenger. please help me. ...

compact framework merge datagrid cells

hi i couldn't find nothing useful for this problem can anybody help me out i'm using c# ...

How to subscribe to EventHandler of a private control outside of Form

Hi all, maybe my design is not good, or I don't see the obvious solution, but I want to subscribe to a buttonClick EventHandler of Form1 from outside form1. For example I have a Controller and Form1 who are both instanced in the main function. Now I want to subscribe a function from Controller to the buttonClick event from Button1_Cl...

DataGridView and Binding List Event.

I have a datagridview with a datasource of type binding list. I understand that when the datagridview changed this will update the items in the binding list. I also know that if the objects in the bindinglist implement Inotifypropertychanged then if the obects are changed outside the grid then the objects will notify the bindlist which...

Highlight the first row in a ListView and a ListBox Control

I am attempting to show both a ListView and ListBox on a Windows Form (C#). The difficulty I am having is in having the first row for both the ListView and ListBox highlighted when the application opens. Could someone please steer me in the right direction so that the first row of both the ListView and ListBox are highlighted when the ...

How do I stop the designer from filling in my properties with null values?

When I add a control to a form, visual studio assigns various of the properties of that form a value of null in the auto-generated designer code. I don't want the designer to make the redundant assignment (the value is already null). Can anyone tell me how to prevent it? example MyControl has property public SomeClass MyProperty {...

Gotchas of moving from developing ASP.NET to Winforms apps

Hi, After developing ASP.NET apps exclusively for several years I'm about to start developing Winforms apps. What are the gotchas that I should be looking out for with this changes? For instance the way object lifetime is managed in the winforms paradigm. I'm sure there must be plenty of gotchas / differences between the two that I need...

how to host datetimepicker in datagrideview control in c# winforms

private void showdate(DataGridViewCellEventArgs e) { dateTimePicker1.Size = vacation_transDataGridView.CurrentCell.Size; dateTimePicker1.Top = vacation_transDataGridView.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Top + vacation_transDataGridView.Top; dateTimePicker1.Left = vacation_transData...

How to focus a control in an MDIParent when all child windows have closed?

I have a control in my parent mdi form which I wish to be given the focus if all mdi children have closed. I've tried hooking into the child form's FormClosed event and setting the focus from there but when I test it, my control is not left with focus when I close the mdi child. Can anyone tell me what I'm missing? In the sample below...

WinForms HTML visualizing controls comparison

Hello all! I am working on some project which requires some HTML visualizing control (WinForms). Currently I am aware only of two such a controls: AxWebBrowser (as far as I understand this is IE-based ActiveX control for winforms) Nabu HTMLView (open source library with visualizing capabilities). Are there any other choices? What are t...