custom-controls

Creating a WPF Hybrid Control (TreeView + DataGrid = DataTreeGrid)

为君一笑 提交于 2019-12-18 10:44:51
问题 I need to create a TreeView that hold synchronized data, like a DataGrid. To clarify, take a look at this image: So, I have a TreeView at left side with columns at right side. The data will come from objects like this: public NodeData Parent; public List<NodeData> Children; public String Label; public Boolean DataA; public Boolean DataB; public Boolean DataC; public Boolean DataX; public Boolean DataY; public Boolean DataZ; How can I create this? 回答1: http://blogs.msdn.com/b/mrochon/archive

Data Binding not working for User Control's custom Property with Dependency Property (Output window is clean)

喜你入骨 提交于 2019-12-18 09:46:34
问题 Note: I am not having problem with controls inside User Control like other similar articles on StackOverflow, I am having with a Property of the User Control itself. I am making a Custom Control based on Canvas, with a Dependency Property (using propdb template): public sealed partial class PresentationViewer : Canvas { #region Properties public ISlide PresentationSlide { get { Debug.WriteLine("Get PresentationSlide"); return (ISlide)GetValue(PresentationSlideProperty); } set { Debug

ASP.NET Custom Button Control - How to Override OnClientClick But Preserve Existing Behaviour?

喜你入骨 提交于 2019-12-18 08:26:38
问题 So i have a ASP.NET 4 Custom Control called "SafeClickButton" which is designed to override the default behaviour of the client-side click (OnClientClick). Essentially i'm trying to disable the button on click, then do any existing functionality (validation, postback, etc). It looks to be correctly rendering the HTML (onclick="this.disabled=true;__doPostback...), and it is disabling correctly, but the problem is with the page validation. If any validation on the page has failed, its posting

ASP.NET Custom Button Control - How to Override OnClientClick But Preserve Existing Behaviour?

∥☆過路亽.° 提交于 2019-12-18 08:25:16
问题 So i have a ASP.NET 4 Custom Control called "SafeClickButton" which is designed to override the default behaviour of the client-side click (OnClientClick). Essentially i'm trying to disable the button on click, then do any existing functionality (validation, postback, etc). It looks to be correctly rendering the HTML (onclick="this.disabled=true;__doPostback...), and it is disabling correctly, but the problem is with the page validation. If any validation on the page has failed, its posting

Using enum as a dependency property in WPF

拟墨画扇 提交于 2019-12-18 04:54:34
问题 I try to use enum type as a dependency property in my custom control, but always get an error: public enum PriceCategories { First = 1, Second = 2, Third = 3, Fourth = 4, Fifth = 5, Sixth = 6 } public static readonly DependencyProperty PriceCatProperty = DependencyProperty.Register("PriceCat", typeof(PriceCategories), typeof(CustControl), new PropertyMetadata(PriceCategories.First)); }; public PriceCategories PriceCat // here I get an error "Expected class, delegate, enum, interface or struct

BlackBerry - Creating custom Date Field

对着背影说爱祢 提交于 2019-12-18 03:44:42
问题 i want to create a field that looks like this ....can any one tell me how this could be done which field could i use where in i can select values by using the trackball/wheel or in case of storm i could slide... 回答1: It could be simple Label or Bitmap Field extention, with navigation event handling. You will need to hold String array with values which will be changed in circle on horizontal navigation. If such custom Field is focused, draw Up and Down arrays. So, there will be one such Field

Having custom controls still apply when go fullscreen on a HTML5 video?

让人想犯罪 __ 提交于 2019-12-18 01:07:06
问题 I've made custom controls for my HTML5 video but I don't know how to have that CSS still apply when I go fullscreen. Here's the [website] I've based my controls on. On this site, you'll notice that when you click the fullscreen button the custom controls get lost and the video reverts to the default <video> controls. Does anyone know how to have these custom controls styling/CSS still apply when you go fullscreen? 回答1: i answered my own question, the key is that the custom controls are inside

How to set a custom view's intrinsic content size in Swift?

戏子无情 提交于 2019-12-17 21:45:14
问题 Background I am making a vertical label to use with traditional Mongolian script. Before I was just rotating a UILabel but there were some performance issues and other complications with this. Now I am working on making a label from scratch. However, I need the vertical label to tell auto layout when its height adjusts (based on string length). What I have read I read the Intrinsic Content Size and Views with Intrinsic Content Size documentation. These were more about how to use it, though,

How to creating EmptyDataText for DataGridView in Windows Application

时光毁灭记忆、已成空白 提交于 2019-12-17 19:45:17
问题 Today i am facing problem to show/hide label according to data source. If the data source has no row then i would like to set "No Data Found" else display number of records in winforms application . This would be possible in Asp.net like: <emptydatatemplate> No Data Found </emptydatatemplate> OR EmptyDataText=" No Data Found" But I would like in Windows Application . Please help me if you have any solution for the same. Any solution would be appreciated! Thanks, Imdadhusen 回答1: One way you

How can a control handle a Mouse click outside of that control?

偶尔善良 提交于 2019-12-17 18:36:07
问题 I'm writing a custom control and I'd like the control to switch from an editing state to it's normal state when a user clicks off of the control. I'm handling the LostFocus event and that helps when a user tabs away or if they click on to another control that's Focusable. But if they don't click on something Focusable, it won't switch out of it's editing state. So I have two solutions in mind: Walk up the tree to the top most element when it goes in to an editing state and add a handler for