user-controls

How can I debug at design time?

强颜欢笑 提交于 2021-02-06 10:01:10
问题 I created a custom ListView with a UserControl. When the mouse enters the ColumnHeader it should change color at design time. It works, but I need to debug code. How can I debug code at design time? 回答1: See Walkthrough: Debugging Custom Windows Forms Controls at Design Time (MSDN). Or in a shorter way to do it just once: Start Visual Studio twice with the same solution. The first with an opened designer of your control, the second to attach by using menu Tools → Attach to Process → the other

WPF - UserControl default Content attribute

陌路散爱 提交于 2021-02-05 20:22:52
问题 I'm creating a UserControl and I just can't remember the name of the attribute which you use to decorate the property which you want to act as the default content property. To give a concrete example, say i have a property called 'Title' which i can set using property syntax like this - <local:myControl Title="the title"/> But the consumer of the control may want to use element syntax like this - <local:myControl> the Title </local:myControl> I KNOW there is an attribute which I need to add

Property edit style as DropDown in a VS .NET custom component

我的梦境 提交于 2021-02-05 06:58:05
问题 I'd like to use the functionality of a ComboBox as edit option for a var in the properties window of a custom control / component. Not the ComboBox component itself. As example: private string[] _stringArray = { "string0", "string1" }; public string[] StringArray { get { return _stringArray; } //callback //set { _stringArray = value; } } As you know this will give me the object browser as view/edit option in the property window. Funny thing that I can edit the values even with no setter. In

How to flip a User Control added in a picturebox by 180 degrees?

大憨熊 提交于 2021-01-29 10:11:12
问题 I'm adding a control to a picturebox. This control is a component, precisely it's a toggle switch posted here. I'd like this control to be vertical and not horizontal . So, since objects can't be rotated or flipped, I found a way to flip the picturebox image with: PictureBox1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone) PictureBox1.Refresh() The error I'm getting at RunTime is: System.Windows.Forms.PictureBox.Image.get returned Nothing Endeed the control is not an image so is there a

Updating control property breaks OneWay binding?

给你一囗甜甜゛ 提交于 2021-01-29 10:04:56
问题 Consider this very simple example where I have a UserControl like this: UserControl XAML: <UserControl x:Class="BindingTest.SomeControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="SomeControlElement"> <Grid> <TextBlock Text="{Binding ElementName=SomeControlElement, Path=Counter}" /> </Grid> </UserControl> Code Behind: using System; using System.Windows; using System.Windows.Controls; using System.Windows

Winform passing data between user controls

蹲街弑〆低调 提交于 2021-01-29 07:06:23
问题 I have windows form application which has several user controls - each one is displayed when the relevant option is selected from a listbox. Some of the user controls need to have access to data stored in a different user control so User Control A needs to know a value of a textbox stored in User Control B. I have done my exposing some properties in the user control B. This all works fine when the application first loads and no values are changed. The problem I am having is if the value of

WPF UserControl: setter not called on binding one property in multiple controls and back

谁都会走 提交于 2021-01-29 04:31:56
问题 I've got a problem with my WPF UserControl binding one property in multiple controls and back. The setters of the business object will not be called. I searched for hours now and tried serveral things which did not work. My Code Can be download here: WpfApplicationUserControlProblem.zip My Business object has 2 DateTime Values to be bound. public class BusinessObject { private DateTime _value1 = DateTime.Today.AddHours(10); public DateTime Value1 { get { return _value1; } set { _value1 =

EM_SETCUEBANNER sendmessage vb.net usercontrol not working

微笑、不失礼 提交于 2021-01-28 20:08:56
问题 If I use the code shown below on a vb.net winform the cue banner / watermark appears and behaves as expected (Win7 Pro 32bit VS2008 & 64bit VS2010). However when using the same style of code in a vb.net usercontrol the watermark is not displayed. Anyone got any clues? Some hours later... This is looking like PEBKAC. Works in a test app. with user controls. Both those created at design time and those loaded at run-time, still doesn't work in the main app. though. Still puzzled. Still looking

Winforms: Scrollable FlowLayoutPanel with thousands of user controls - How to prevent memory leaks and dispose objects the right way? [closed]

梦想的初衷 提交于 2020-12-31 01:43:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . Improve this question I am relatively new to windows form programming. I am developing a windows form application which requires user to scroll through the form (I have used a FlowLayoutPanel with AutoScroll=True inside the form). The Panel's source contains an user control which

Winforms: Scrollable FlowLayoutPanel with thousands of user controls - How to prevent memory leaks and dispose objects the right way? [closed]

守給你的承諾、 提交于 2020-12-31 01:36:39
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . Improve this question I am relatively new to windows form programming. I am developing a windows form application which requires user to scroll through the form (I have used a FlowLayoutPanel with AutoScroll=True inside the form). The Panel's source contains an user control which