user-controls

Can I add a DependencyProperty on an windows user control?

吃可爱长大的小学妹 提交于 2019-12-24 17:37:21
问题 I'm trying to host a Visio ActiveX object in a WPF application. To do this, I created a Windows user control project where I add the Visio object. This windows user control is then hosted on an WPF user control in an WindowsFormsHost object. <WindowsFormsHost Name="wfHost" Grid.Row="1"> <wf:VisioUserControl FileNamePath="?"/> </WindowsFormsHost> What I would like to do is to bind the value of the FileNamePath member to the value of a TextBox element which defines the path. The project follows

ControlCollection items could not be saved

我们两清 提交于 2019-12-24 17:17:21
问题 I have created a control with controlcollection. When I add items from the property window at design time. It added perfectly. Also when I open it back. Added items shows me. But, When I close the form then open it again the items was removed. Now I have added two Items in the collection. The items was looking perfectly. But, When I open the Form.Desigern.cs file the following line is missing. this.xWizardControl.Window.Controls.Add(this.xWizardPage1); this.xWizardControl.Window.Controls.Add

Load data into a UserControl as control properties or in control code behind?

我怕爱的太早我们不能终老 提交于 2019-12-24 17:04:44
问题 I'm building a UserControl that will repeat on the page a variable number of times. I'm trying to determine what the most efficient way to handle the data I will be loading into the Control. For the sake of simplicity, lets say it will be structured something like this: <table> <tr> <td>Header Item</td> </tr> <tr> <td>Body Item n</td> </tr> <tr> <td>Body Item n+1</td> </tr> <tr> <td>Body Item n+2</td> </tr> <tr> <td>etc.</td> </tr> <tr> <td>Footer Item</td> </tr> </table> All of the data that

Accessing font properties of wpftext control in codedUI testing

試著忘記壹切 提交于 2019-12-24 16:46:03
问题 I want to check whether font is bold or not and also its color in codedui testing. I am using wpftext control . Please help me. 回答1: Saran, Unfortunately, this is not as straightforward as it probably should be, but it can be done by creating a CodedUI Test Framework Extension which sets an AutomationProperties.ItemStatusProperty to the current Font. One benefit of doing it this way is that it works with the test recorder and allows you to generate assertions and/or hand-code validations.

WPF Lost-Focus issue in same control

喜夏-厌秋 提交于 2019-12-24 15:32:56
问题 I have a small problem with focusing in .net/wpf. I have written a custom user control which contains a TextBox and a SearchButton . The user-control has a lost focus event, which validate the content of the textbox if the focus is leaving. But now i have the problem, if i click on my search button, the lost focus event of the user control gets fired, even if i click on the button in the custom user control. (The button additionally has the option TabStop="False" : The problem is, that i don

namespace in asp.net usercontrol

北城余情 提交于 2019-12-24 14:34:54
问题 I make a asp.net usercontrol. its name is ucTreeview. in my page it named: uc1:ucTreeview How can i rename uc1? 回答1: When you register the control you're declaring prefix using <%@ Register ... http://www.15seconds.com/Issue/020319.htm 回答2: You need to use the assembly:TagPrefixAttribute This page on MSDN is a concise example of how to do that. 来源: https://stackoverflow.com/questions/1635418/namespace-in-asp-net-usercontrol

Change Worksheet When a Cell Value and a Checkbox Change

本秂侑毒 提交于 2019-12-24 14:28:06
问题 I have a Workbook with multiple Sheets. I have a menu page (Worksheet) with multiple user choices (Enter a new order, update an order, etc.) Each choice has a check box beside it and depending on which check box is checked, cells F4:F21 change from 0 to 1 and, cell B1 changes to the name of the Worksheet where I want to go. I have the following VBA in the Main Menu worksheet but when I click a check box, nothing happens. Any ideas why? CODE Private Sub Worksheet_Activate() ClearMenuForm End

C# WinForm Validate Checkbox and Error if at least one is unselected

こ雲淡風輕ζ 提交于 2019-12-24 13:25:51
问题 I seem to have a problem with validating my user control. Help would be awesome :) If I have at least one check box checked, I will process through a loop all checkboxes. If I have no checkboxes checked, the form generates an error. An if with just one checkbox before the foreach would be an easier solution for me but I have quite a lot of checkboxes on this user control and dont want to list them all.... Also I think there is some logic problem, cos even select a checkbox I still get my

Duplicate buttons in Update Panel and JavaScript Hack

三世轮回 提交于 2019-12-24 13:04:11
问题 In reference to my question, Page.Unload Event inside a Update Panel I am able to make it work but I got two buttons that do partial post back and then in my script I can do what I want, but I want it to work for just one button not two of them, best thing is button I want to make this request work for is Image button whereas other button is just a simple button. This is a User Control in ASP.NET by the way. <script type="text/javascript"> // if you use jQuery, you can load them when dom is

Handling Kinect in Main Window and passing this reference to UserControls

核能气质少年 提交于 2019-12-24 12:23:22
问题 I have a project in WPF with a lot of UserControls, some user controls uses Kinect KinectColorViewer.xaml I want to handle the sensor discovering and setup (conect, disconect, etc) in main window and serve it to my UserControls, how is the best way to do it? Here is the project that explains my question. If you prefer, here are the github link. 回答1: From your example code, Assuming you want to maintain as much of the already available code from Microsoft, you will want to set up a reference