designer

How can I prevent the VS WPF designer putting margins on every object from the toolbox

送分小仙女□ 提交于 2019-12-10 14:21:13
问题 When I drag a control from the toolbox on to the Visual Studio 2008 WPF design surface, it sets a margin based on where I dropped it and a default size. Is there any way to prevent VS setting those? When I drop a control on a stackpanel I want it to flow in to the existing controls in the panel. Thanks! 回答1: I've never found a way to prevent this. I just type the XAML instead. EDIT : I wrote the above nearly three years ago. In the meantime, it would appear that the design-time experience has

How can I add item data to QComboBox from Qt Designer/.ui file

女生的网名这么多〃 提交于 2019-12-08 19:12:04
问题 I'm using Qt Designer (well, Qt Creator actually, but specifically the part derived from Qt Designer), and I've added a few QComboBox items to a dialog with a constant list of items. I need to map the items in the combo box to strings (which are distinct from the displayed strings). The best idea I've come up for it is to use the QComboBox::itemData function to get the needed string from the selected item, but I'm having trouble adding the associated strings to the items. I've looked all over

Why does QT designer re-size or not allow me to shrink or expand widgets or buttons?

放肆的年华 提交于 2019-12-06 20:53:45
问题 Often times while using QT designer I find myself needing to re-size things either by shrinking or expanding them. Whenever I try to do this the program does not allow me and simply reverts to the original default size it gives me when placing the object within my window, regardless of the layout I have. Why does it do this? And is it possible to change this so that I can re-size things to my own will without restrictions? I have been trying to learn how to properly use QT designer, but I can

Visual studio shows endless messages “Code generation for property 'valueMember' failed.”

送分小仙女□ 提交于 2019-12-06 18:29:48
问题 After several days of happily hacking away on this C# app using Visual Studio 2008, I get struck by a barrage of error dialogs showing: Code generation for property ' valueMember ' failed. Error was: ' Object reference not set to an instance of an object .' This happens now often when I make a tiny change in the designer, e.g. shift a control a few pixels, and then try to save. Several such error dialogs appear each second, keeping me busy cancelling all those by hammering the Enter key while

How to display placeholder value in WPF Visual Studio Designer until real value can be loaded

大憨熊 提交于 2019-12-06 18:21:48
问题 I'm an experienced C# developer but a WPF newbie. Basic question (I think) that I can't find an answer to by web searching. Here's the simplified use case... I want to display a string in a WPF TextBlock. So I write some C# code in codebehind of my XAML control... public class MyCoolControl : UserControl { public void InitializeMyCoolControl() { this.DataContext = "SomeStringOnlyAvailableAtRuntime"; // Perhaps from a database or something... } } And I set up my XAML like this: <UserControl ..

Winforms Designer: Modify (and keep) properties in sub objects

帅比萌擦擦* 提交于 2019-12-06 14:00:46
问题 For a WinForms control, I'd like to move certain settings into a sub object. One of them is a custom class containing all UI Strings, the other a OpenFileDialog: class MyControl: Control { // ... private OpenFileDialog m_dlgOpen = new OpenFileDialog(); public OpenFileDialog DialogOpen { get { return m_dlgOpen; } } } This adds the sub object to the designer, and allows to edit its properties (e.g. title, default extension, filter). However, the changes are nto added to the InitalizeComponent

wpf xaml designer bug

拟墨画扇 提交于 2019-12-06 03:46:40
问题 every time we open a *.xaml file in our project - we see not working designer and a lot of messages 'type not found' 'assembly not found' etc. After a couple of experiments, i found out a root of a problem : create new WPF application, create a folder in project root, add some value converter to folder, try to use it on your 'MainWindow.xaml' you will probably write something like this : xmlns:Folder="clr-namespace:WpfApp.Folder" and then <Window.Resources> <Folder:SomeValueConverter x:Key=

VS2010: How to avoid Windows Forms designer problems when working with inherited user controls?

社会主义新天地 提交于 2019-12-06 01:27:18
问题 Problem: The Windows Forms designer does not work for an inherited user control when the base class is implementing an interface from another assembly. Platform: VS 2010 SP1, .NET 4.0 Framework Error: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: MyControl --- The base class 'MyBaseControlLib.MyBaseControl' could not be loaded. Ensure the assembly has been referenced and that all

Visual Studio 2012 XAML designer doesn't seem to update

北城以北 提交于 2019-12-05 19:45:12
问题 I seem to have a sudden issue with my XAML Designer view in VS2012, and a similar behavior in Blend as well. the view has stopped updating and I'm unable to see any changes immediately if I change any properties. if I scroll or Pan, the Phone chrome seems to move but the content stays put. It gets restored upon slightly adjusting the borders or restarting the page. has anyone else faced this issue? do you know what I need to do? I'm using Visual Studio 2012 Professional (Update 2) this image

How can I customize the code generation of InitializeComponent? More specifically, how can I post-process all of the generated code?

廉价感情. 提交于 2019-12-05 17:13:48
问题 I'm trying to customize the Windows Forms Designer's code generation for InitializeComponent . The MSDN article "Customizing Code Generation in the .NET Framework Visual Designers" contains a section "Controlling Code Generation" that explains the basics of how this can be done. I've closely followed an example in the above article: //using System.ComponentModel.Design.Serialization; class SomeFormSerializer : CodeDomSerializer { public override object Serialize(IDesignerSerializationManager