windows-forms-designer

Why do my forms look like 'Windows Classic'?

▼魔方 西西 提交于 2019-12-12 07:25:08
问题 Is there any free tool to style my C# Windows Forms, to make them look like Windows 7 Windows. **EDIT** In the designer mode, I have this : But when I run I get this : I don't know why I get that. (Old style) Thanks 回答1: You should enable visual styles look Application.EnableVisualStyles Method Call this method before creating any controls [STAThread] static void Main() { Application.EnableVisualStyles(); Application.Run(new YourMainForm()); } 来源: https://stackoverflow.com/questions/6466282

I made a rectangle how do I check if the mouse clicked on it?

别来无恙 提交于 2019-12-12 02:12:42
问题 How do I check if a mouse clicked a rectangle? Graphics gfx; Rectangle hitbox; hitbox = new hitbox(50,50,10,10); //TIMER AT THE BOTTOM gfx.Draw(System.Drawing.Pens.Black,hitbox); 回答1: Just a sample quick and dirty, if your "gfx" is a "e.Graphics..." from a Form: public partial class Form1 : Form { private readonly Rectangle hitbox = new Rectangle(50, 50, 10, 10); private readonly Pen pen = new Pen(Brushes.Black); public Form1() { InitializeComponent(); } private void Form1_Paint(object sender

Multi-language telerik windows forms

ぃ、小莉子 提交于 2019-12-12 01:59:49
问题 I have a full windows application made by Telerik with Ribbons and I want to make it Multi language interface (English and Arabic) I set the localizable property to true and changed the interface for each language.... And created a method that loops on the controls in the form and Apply the resources with the selected language The problem is that I can't find a generic method to loop on the Telerik controls to apply the resources for each Rad Control Please help Or if there is another way to

Display outlook folder tree in a form (outlook add-in project)

早过忘川 提交于 2019-12-12 01:59:24
问题 I want to customize the mail moving functionality of outlook. So to do that I am creating a outlook plugin and when user want to move a mail, I will show a windows form via that add-in. In that windows form I want to display the current folder tree of outlook as in the following image (this image is from mail move functionality : mail --> right mouse click --> move -> to other folder). Is there a way that I can get similar tree by extending already having outlook UI component ? I am using

Design-time moving of a child control owned by a composite user control

烂漫一生 提交于 2019-12-11 21:31:45
问题 I have a Windows Forms user control, which (for various reasons irrelevant to this issue) are exposed in the designer, much like the panels in a split panel. Most everything works nicely, except for dragging the control. The child controls are created by the user control, and it does not accept new children. The intent is only to allow the properties of the predefined children to be edited. Since the control allows the child controls to be designed, they can also be selected in the designer

Combining multiple Attributes to a single Attribute

爷,独闯天下 提交于 2019-12-11 15:49:12
问题 On a control I am using multiple attribute properties: [Browsable(false)] [Bindable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Obsolete("", true)] public new Boolean AllowDrop; I am using those properties on a lot of the other control properties as well. I am wondering if there is a way to reduce the amount of code to write each time. It would be nice if I could combine multiple attributes like this: [Hidden

Windows Forms Datagridview (Select part of text in cell with mousepointer but dont allow edit) VB.NET

若如初见. 提交于 2019-12-11 15:11:50
问题 Hey guys i have a gridview on my form with readonly = false and enabled = true so i can select a part of the text in a cell of a datagridview. This works ok but when i have the settings like this its also possible to edit the text and thats the part i dont whant. So i am looking for a solution to be able to select a part of the text within a cell of a datagridview but dont allow the users to edit the values that are in there. Tanx in Advantage 回答1: dataGridView1.ReadOnly = false and

How to apply same style on all buttons in windows form

守給你的承諾、 提交于 2019-12-11 11:18:40
问题 i have multiple buttons in my windows form application , and i want to apply some style on btnhover like this private void button1_MouseEnter(object sender, EventArgs e) { button1.UseVisualStyleBackColor = false; button1.BackColor = Color.GhostWhite; } private void button1_MouseLeave(object sender, EventArgs e) { button1.UseVisualStyleBackColor = true; } i want to put this style at one place and i want that it atuomatically apply on all buttons in my form . how can i do this , Please help me

Is it possible to reference a user control in the same Windows::Forms project?

China☆狼群 提交于 2019-12-11 10:36:45
问题 I have a Windows::Forms application and I want to add a custom control to it (which basically displays some images and links them with some bezier curves I'm drawing). I'm sure I've managed to get Windows Forms designer to display the custom controls in the same project before but I can't get it to work this time. It just says: C++ CodeDOM parser error: Line: 524, Column: 33 --- Unknown type 'MyNamespace.MyCustomControl'. Please make sure that the assembly that contains this type is

Is it possible to control how IExtenderProvider formats the output in the Windows Forms Designer code?

空扰寡人 提交于 2019-12-11 10:17:21
问题 I have a class that implements IExtenderProvider Here is a great article about that interface http://www.codeproject.com/Articles/4683/Getting-to-know-IExtenderProvider The basic idea is to select a control in the windows forms desinger and have a "virtual" property MyProperty on MyExtender The tooltip does the same. This works as expected and the designer code looks like this this.label1.AutoSize = true; ... this.myExtender1.SetMyProperty(this.label1, "MyValue"); ... this.label1.Name =