windows-forms-designer

How to add a resource file to Visual Studios so that it's visible in “Select Resource” dialog?

∥☆過路亽.° 提交于 2019-12-10 23:35:41
问题 In Visual Studio you can edit image of a button control using the GUI editor (aka "designer"). I want to organize my resources into two *.resx files placed in the "Properties" folder of the project. My problem is that the "Select Resource" dialog in Visual Studio is only displaying the "Properties\Resources.resx" file, and none of other *.resx files. How can i add a file to the "Project resource file" drop down? If can't, why is it a drop down select than? 回答1: Select Resource Dialog Box

Pass properties of parent control to children controls

淺唱寂寞╮ 提交于 2019-12-10 23:08:47
问题 I am developing a set of custom controls for a specific application. I want to define properties which is universal over the set of controls for appearance purposes, for argument's sake let's make it CustomCtrl.AccentColor I want to define that same property for my Windows form i.e. Form1.AccentColor and when I change it, all the custom controls' AccentColor should change, exactly like when I change the ForeColor of my form, all labels' and buttons' etc ForeColor changes with it. Is it at all

How to design reusable context menus?

余生长醉 提交于 2019-12-10 20:27:27
问题 I'm developing a WinForms .NET application. I have few context menus which are used on various places including some user controls. There is no ultimate root form which could hold those menus (I could design in those form's designer) on a single place. I would like to make those menus standalone controls and be able to drop them from Toolbox wherever I need. I know how to do it programmatically/dynamically but without designer support. Perhaps I'm just missing something. Is there a way how to

FlowLayoutPanel autosize

…衆ロ難τιáo~ 提交于 2019-12-10 18:19:23
问题 I have flow layout panel dock (Fill) in parent container. The Parent container DockStyle is set to Top. Also I set the FlowDirection property to LeftToRight for flow layout panel and the AutoSize property to True for both containers. The main function of flow layout panel is to keep dynamically added buttons. The Code for creating Buttons Button productButton = new Button(); productButton.AutoSize = true; productButton.AutoEllipsis = false; productButtonPanel.Controls.Add(productButton);

Visual Studio Designer - Limit property grid to show some specific languages for Language property

我是研究僧i 提交于 2019-12-10 17:48:57
问题 I am developing in Visual Studio 2013 (C#) and am searching for a way to make the selection of languages for a windows form easier for localization. In the designer you have the possibility to select the language you want under " Design "→" Language " and Visual Studio does the rest by creating the necessary localization files if you need a new localized form. The problem is: Currently I only work with two different languages, and every time when I switch between those localized forms it

C# DataBinding - automatically writing changed property to label or textbox

寵の児 提交于 2019-12-10 16:22:27
问题 I read some about DataBinding, mostly complicated things like SQL or whatever XAML and stuff. All I want my programm to do is, if the "value" of a variable changes just write it in a textbox or label. (using WindowsForms) So far what I have: namespace DataBinding_Test { public partial class Form1 : Form { BindingSource bs = new BindingSource(); Class1 test = new Class1(); public Form1() { InitializeComponent(); test.name = "Hello"; bs.DataSource = test; label1.DataBindings.Add(new Binding(

Standard margins between controls and standard control sizes

不打扰是莪最后的温柔 提交于 2019-12-10 16:08:12
问题 For example, Windows Forms Designer offers to place my controls on the form the way there are 12 pixels between form border and control border. It seems too much to me. Is it standard value? Also, as I understand standard button height should be 23 pixels. Am I right? Is there any documents that state all this? And can I setup this default values in Visual Studio (for example what if want default margin between control and form borders, when the snap appears, to be 6 pixels instead of 12)?

Windows Forms Designer - automatically adds namespace in front of class

让人想犯罪 __ 提交于 2019-12-10 15:50:00
问题 I have problem with Visual Studio Designer. When I display design of a form, designer automatically adds namespace in front of class, which is used as datasource. But this class is in the same namespace as the form. It is annoying. Example: namespace Editor { partial class AddSignalForm { ... this.signalsBS.DataSource = typeof(Signal); } } Signal is in namespace Editor . But after I open designer, code is changed to: namespace Editor { partial class AddSignalForm { ... this.signalsBS

EF in a UserControl can't see the app.config?

会有一股神秘感。 提交于 2019-12-10 13:34:25
问题 I just created a user control. This control also makes use of my static Entity Framework class to load two comboboxes. All is well and runs without a problem. Design and runtime are working. Then when I stop the application all the forms that contain my UserControl don't work any more in design time. I just see two errors: Error1: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. Error 2: The variable

Real Hint in TextBox Visual Studio C# [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-10 11:09:54
问题 This question already has answers here : Watermark TextBox in WinForms (8 answers) Closed last year . I'm currently making a Windows Forms Application on Visual Studio in C# and I'm trying to find a way to have a real hint . I've found a lot of answers online on how to have some text preset there, Some examples even show how to grey out the text to look like a placeholder, but that's not what I'm looking for. I want a grayed out text that you don't have to backspace to type something there.