custom-controls

Custom View in UIAlertController

醉酒当歌 提交于 2019-12-12 09:53:17
问题 I am trying to put a custom view inside a UIAlertController . I'm running into some odd issues with the sizing of the custom view. I want the custom view to span the width of the UIAlertController , whatever that might be. I'm using CGRectGetWidth(alertController.view.bounds) to get the width of the alert controller. However, this seems instead to be returning the width of the entire view. using view.frame does not make a difference. UIAlertController *alertController = [UIAlertController

Custom pictures for checkbox?

北慕城南 提交于 2019-12-12 09:34:39
问题 I would like to show checkbox as toggle button. But I can't apply my custom pictures to it with CCS -- still checkbox is drawn. How to accomlish this task? My CSS: input[type=checkbox]#settingsbutton { border-style: none; background-color: transparent; width: 42px; height: 40px; display: block; } input[type=checkbox].button-settings { background-image: url("images/button-settings-normal.png"); } input[type=checkbox].button-settings:active { background-image: url("images/button-settings-normal

Outer Glow Effect for Text in a Custom Control

百般思念 提交于 2019-12-12 09:26:52
问题 How to apply Outer Glow on text of Label in c# winforms, and Blur Effect. Using Custom Control As you See, This is Custom Panel and I'm trying to do Glow Effect for the entire text. protected override void OnPaint(PaintEventArgs pe) { //base.OnPaint(pe); StringFormat sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; GraphicsPath GP = new GraphicsPath(); GP.FillMode = FillMode.Alternate; GP.AddString(this.Text, this.Font.FontFamily, 2,

XAML binding doesn't seem to set if the property is initialized in the constructor

不羁的心 提交于 2019-12-12 08:48:44
问题 I've run into a problem with data-binding inside control template while the property is initialized inside the constructor. Here is the show-case (you can also download sample solution): CustomControl1.cs public class CustomControl1 : ContentControl { static CustomControl1() { DefaultStyleKeyProperty.OverrideMetadata( typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1))); } public CustomControl1() { Content = "Initial"; // comment this line out and everything // will

WPF: How to make an overlay control with transparent canvas and clickable child

断了今生、忘了曾经 提交于 2019-12-12 07:47:15
问题 I want to make a custom control which will be used as an overlay. The control should contain a couple of child controls which should be drawn and should be clickable as usual. But everything else in the control should be transparent and "clickable-through". Here is how I try to achieve this... First, I'm using PreviewMouseDown\Up\Move events in the window where the overlay is going to be placed. I want these events to "go through" transparent part of my custom control, but stop at not

Why am I being told a class does not exist in my namespace when it does?

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:57:51
问题 I am trying to follow the article here to add a custom control to my project so that I can call it ("promptForPhotosetName") like so: Popup popTart = new Popup(); popTart.Child = new promptForPhotosetName(); popTart.IsOpen = true; I added a Custom Control to my project based on Templated Control. My custom control class (which IS in the Photrax namespace) contains this constructor: public promptForPhotosetName() { this.DefaultStyleKey = typeof(promptForPhotosetName); } I have this in \Themes

Angular JS - custome directive is not getting replaced with actual template

只愿长相守 提交于 2019-12-12 04:44:24
问题 I am learning Angular JS and would like to create my custom directive. My javascript code is not showing any error but the custom directive is not getting replaced with my HTML template. Can you please guide on how to debug this issue or what is wrong with this code? jsFiddle link <body ng-controller="customdirectivecontroller"> <p>Placed custom directive here!</p> <mytextbox></mytextbox> </body> ------------------ var customdirectiveapp = angular.module('customdirectiveapp', []);

Asp.net Custom user control button. How to stop multiple clicks by user

两盒软妹~` 提交于 2019-12-12 04:31:10
问题 I am trying to modify an open source Forum called YetAnotherForum.net in the project they have a custom user control called Yaf:ThemeButton. Now its rendered as an anchor with an onclick method in this code ThemeButton.cs using System; using System.Web.UI; using System.Web.UI.WebControls; namespace YAF.Controls { /// <summary> /// The theme button. /// </summary> public class ThemeButton : BaseControl, IPostBackEventHandler { /// <summary> /// The _click event. /// </summary> protected static

C#: ToolStripDropDown doesn't Dispose/DestroyHandle

风流意气都作罢 提交于 2019-12-12 04:29:04
问题 I'm using the ToolStripDropDown to show up an selectionpopup. The ToolStripDropDown contains a few custom controls with running Threads. The Threads ends with the OnHandleDestroyed event, but for some reason the ToolStripDropDown doesn't dispose/destroy it's handle after closing. Disposing the ToolStripDropDown on the closed-event gives me an exception because anything still accesses the ToolStripDropDown. How do I know if the custom Control is still in use or not to end the thread? Custom

wxPython: wx.PyControl layout problem when it is a child of a wx.Panel

浪尽此生 提交于 2019-12-12 04:25:47
问题 This is a continuation from this question: wxPython: Can a wx.PyControl contain a wx.Sizer? The main topic here is using a wx.Sizer inside a wx.PyControl . I had problems Fit() ting my CustomWidget around its child widgets. That problem was solved by calling Layout() after Fit() . However , as far as I have experienced, the solution only works when the CustomWidget is a direct child of a wx.Frame . It breaks down when it becomes a child of a wx.Panel . EDIT: Using the code below, the