winforms

Overriding a Procedure in a Parent from a child control

I'm developing this usercontrol which requires I override the WndProc of the control's parent [which for all practical purposes is a Windows Form] and I'm stumped. Ordinarily, I could drop the user on the form and manually override the forms WndProc. Since my entire development team and possibly others I don't know of right now could be...

How to stretch a panel on fullscreen ?

I have a WinForms application. Application has menustrip, toolstrip and several panels. I want to stretch one of that panels on fullscreen. I want that panel covers all screen include taskbar. How do I do it ? ============================================ I used an answer of Hans Passant: public partial class Form1 : Form { Size...

Binding complex properties to DataGridView Win.Forms.

Hi, everyone! I have problem with databinding in the Win.Forms DataGridView control. Example: public class A { public String Title {get; set; } public B BField { get; set; } } public class B { public String Name { get; set; } } I want to see in my column value from B. (BField.Name). I tried to use the next way for ...

Smartphone win Application 's combobox load problem ...

Am working on smartphone application. Here I have a combobox which loads when the value of another combo gets changed. private void cmbTreatmentType_SelectedIndexChanged(object sender, EventArgs e) { MasterData lData = new MasterData(); cmbTreatmentCategory.DataSource = lData.GetTreatmentCategories((int)cmbTreatmentType.Select...

How do I make my .net winform app stay at 100% text size even if user changes it in the control panel?

I have built a simple app with a single fixed size form window. When a user goes into Control Panel\Appearance and Personalization\Display in Windows 7 and choose a text size of 125% or 150%, my .net form looks terrible with some controls pushed off the edge. What is the best way to avoid this issue? Can I fix my app to always be text ...

Continuously updating data in application from database

Hello, I am writing an application that needs to continuously update its displayed data from a view in a database. Currently, it is periodically polling the entire data set and redisplaying it. I am changing it to be more efficient and am interested in people's opinions on how to do this most effectively. The application is a Windows Fo...

Stop execution of dialogResult based on condition - Winforms

Hello, I'm having a issue with the following scenario on Windows Forms: I created a Form with two buttons, each button have been assigned with the behaviour DialogResult OK and DialogResult Cancel respectively. But based on certain condition I need to stop the execution of the OK button, the problem is that if I just made a return like...

How to have more than one tool strips in a tool strip container, one over another?

I have a tool strip container. I want to add two tool strips in it, such that they both are at extreme right and toolstrip1 is on top of toolstrip2. They both should be vertically aligned. In between both the tool strips should be a track bar. I cannot dock the tool strips to the right in the container as i want to have two toolstrips wi...

Exporting an Image from a WinForms application to PowerPoint with transparency

I've been having trouble pasting an image from my application into PowerPoint, while preserving transparency. I have an image stored as a System.Drawing.Graphics type which I then convert to a System.Drawing.Bitmap type and copy to the clipboard. During this process I also use Bitmap.MakeTransparent(Color.Black) so that everything in the...

Scaling WinForms TableLayoutPanel

I have an issue with TableLayoutPanel, which fills an userControl (DockStyle.Fill). I face a trouble, when this control is being resized, I need all cells to change their size, but only last row and last column changes size (so whole tableLayoutPanel fills the control). I change this controler size using Bounds property. let's say I wro...

Windows Forms DatePicker not behaving in XP

This issue involves a Windows Forms VB.NET application. .NET version is 3.5 I have a datepicker control that is enabled/disabled by a checkbox. When the user checks the box, the datepicker is enabled and they select a date. However, for users running Windows XP, when they select a date the calendar reverts back to disabled and showin...

Winforms Databound ComboBox doesn't update when close Window

I have a combobox that is databound and updates with no issues. The problem I have is if the user types something into the combobox and then uses the [X] close button in the window without tabbing out, the data is not updated. I've been looking all over the web, but can't find any relevant help/tips. The only idea is have is to force an ...

Opaque Form Overlay Without Covering Task Bar

Using Visual Studio 2008 and VB.NET ... I've created a form (OpaqueForm), which is an intermediary form between other forms which I will open with ShowDialog. The idea is that when I want to show a form using .ShowDialog, this OpaqueForm, with an opacity other than 100%, sits in between the main form and the dialog form, effectively "gr...

Toolstrip Accelerator Text

I am trying to get the text of a ToolStripMenuItem as if it has been rendered for drawing. If I have this: var ts = new ToolStripMenuItem("&New File..."); I want to get "New File...", and there does not seem to be a property to get this information. I had a look through the TextRenderer and ToolStripRenderer classes in Reflector, an...

How can I have my listbox have columns?

I want my ListBox to have columns, and one of those columns have to be a clickable URL. How can I achieve this? ...

reportviewer is not visible in c# express 2010 win form at design-time

I installed Microsoft Report Viewer Redistributable 2008 and use report viewer in the C# express 2008 win forms, also i installed Microsoft Report Viewer Redistributable 2010 and use it in the C# express 2008 win forms, but in c# express 2010 when i add reportviewer (2008 and 2010) to win form it is not visible at design-time, why? ...

drop-down list but as a tree view in .net

Hello I have a winform where I want the user to select an item and subsequently show the item in the form, much as a combobox but when it is dropped a tree view is shown. Two reasons for not using plain list: 1. The items is logically ordered in an hierarchical structure that I would like to show 2. It can be potentially a lot of it...

Finding objects by their name.

I was wondering how could I select objects which were created during programs runtime. Each object has its unique name. How could I select that object by its name? Example names: "mapPart_0_0" "mapPart_0_1" "mapPart_0_2" etc. It's a windows form project. In c#. Creation of those objects: private void addBoxes() ...

A good html capable richedit replacement for winforms?

Hi Can anyone recommend a html replacement for a winforms (c#) richedit control? I would like a control like the build in richedit control, that just use HTML instead of rtf to store the text. I don't want it to edit HTML, just to present a editor with images and styled text that store the result in html. I would prefer a free contro...

How do I convert System.Windows.Media.SolidcolorBrush to System.Drawing.Color ?

I need to convert a System.Windows.Media.SolidcolorBrush to a System.Drawing.Color in C# any clues would be great. ...