wpf-controls

WrapPanel not wrapping when in a StackPanel with Horizontal orientation

浪子不回头ぞ 提交于 2020-07-05 05:55:07
问题 The labels in the example below (WPF/XAML) just parade off the screen, no wrapping occurs. Removing the orientation works, but doesn't provided the needed functionality/look & feel. Any ideas how to make the WrapPanel wrap to the current size of the StackPanel ? <Window Height="300" Width="600"> <StackPanel Orientation="Horizontal"> <WrapPanel> <Label Height="28" Name="label1" Width="120">First Name</Label> <Label Height="28" Name="label2" Width="120">John</Label> <Label Height="28" Name=

UserControl VS Page in WPF

心不动则不痛 提交于 2020-06-08 14:50:46
问题 I'm on writing a simple application, it has a menu and when user choices each MenuItem , i want to change my window's content to display the selected content. i have two option to that. i can add a <Frame></Frame> to my window and write some pages. i can write some UserControls and put them in a ContentControl as user fires MenuItem click event. so I'm confused to select the right choice for this purpose. 回答1: Navigation can be succefully implemented by using Frame/Pages or ContentControl

Getting the visibility of a progress bar in a WPF application using FlaUI Automation

本小妞迷上赌 提交于 2020-03-06 06:39:28
问题 I am automating a WPF app using FlaUI . I have a progressbar that is Inderminate . Once the progressbar gets Collapsed , The UI is loaded. I want to implement a Retry mechanism on the ProgressBar Visibility but I am not able to find the correct property through FlaUI private ProgressBar LoadingStatus => _uiAutomation.FindElement("ShowProgress", Automation.FindBy.Id).AsProgressBar(); <ProgressBar AutomationProperties.AutomationId="ShowProgress" Grid.Row="1" Height="4" Margin="0"

Is there a way to create Numberic Textboxes using WPF xaml code?

醉酒当歌 提交于 2020-02-26 00:54:51
问题 I am new to WPF. I need to create textboxes which is only accept digits . Not accepted any special characters, letters . And the important thing is , the code is only xaml not c# . I googled lot of websites , but i only get the code used c#. But i want in XAML code. Because i enclosed it like styles in controls. Is there any way to do this? And if it is not possible Why? 回答1: No, it's not possible because XAML is a markup language. It has no support for distinguishing between digits and other

Using richtextbox as a chat window which displays text having text customization issues in WPF

♀尐吖头ヾ 提交于 2020-02-06 07:57:58
问题 I am making a C# WPF chat messenger, i have used Wpf rich text box for displaying chat, but i am trying to customize nick and do some text alignment, rich text box having text is made by appending text using code, i dont know how to customize it, i am attaching an image for more explanation I want this date to be left aligned, and i want the nick name should be blue in color. I think we cannot use HTML Text in rich text box, or whats the solution for customizing the text, should i use some

Using richtextbox as a chat window which displays text having text customization issues in WPF

南楼画角 提交于 2020-02-06 07:55:06
问题 I am making a C# WPF chat messenger, i have used Wpf rich text box for displaying chat, but i am trying to customize nick and do some text alignment, rich text box having text is made by appending text using code, i dont know how to customize it, i am attaching an image for more explanation I want this date to be left aligned, and i want the nick name should be blue in color. I think we cannot use HTML Text in rich text box, or whats the solution for customizing the text, should i use some

MouseLeftButtonDown is not getting fired

痞子三分冷 提交于 2020-02-04 06:37:12
问题 I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is not getting fired at all for the contol. I added event handler and also tried as follows. I guess it is handled somewhere else, how to debug and find where is it getting hanlded.. Any help is appreciated! protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); } 回答1: Did you have the Background of the UserControl set to something? If not, try setting it to

MouseLeftButtonDown is not getting fired

三世轮回 提交于 2020-02-04 06:37:05
问题 I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is not getting fired at all for the contol. I added event handler and also tried as follows. I guess it is handled somewhere else, how to debug and find where is it getting hanlded.. Any help is appreciated! protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); } 回答1: Did you have the Background of the UserControl set to something? If not, try setting it to

MouseLeftButtonDown is not getting fired

感情迁移 提交于 2020-02-04 06:36:58
问题 I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is not getting fired at all for the contol. I added event handler and also tried as follows. I guess it is handled somewhere else, how to debug and find where is it getting hanlded.. Any help is appreciated! protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); } 回答1: Did you have the Background of the UserControl set to something? If not, try setting it to

MouseLeftButtonDown is not getting fired

淺唱寂寞╮ 提交于 2020-02-04 06:36:06
问题 I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is not getting fired at all for the contol. I added event handler and also tried as follows. I guess it is handled somewhere else, how to debug and find where is it getting hanlded.. Any help is appreciated! protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); } 回答1: Did you have the Background of the UserControl set to something? If not, try setting it to