custom-controls

Visual studio 2008 IDE not rendering Custom Controls correctly

扶醉桌前 提交于 2019-12-05 01:28:02
问题 I'm having an issue at design time with all my forms and custom controls within Visual Studios 2008. Up until the previous check in, all of the controls were rendering as expected. The only main difference between the current version and the previous working version was that a Property on the control UIText was renamed from Content to Value . The other changes are adding a new form and 3 new enums, but there's certainly no obvious change that would affect all forms in the program (including

Custom pictures for checkbox?

情到浓时终转凉″ 提交于 2019-12-05 00:53:41
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.png"); } input[type=checkbox].button-settings:hover { background-image: url("images/button-settings

Outer Glow Effect for Text in a Custom Control

佐手、 提交于 2019-12-04 21:14:08
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, 12f, new Point(ClientRectangle.X+Text.Length*4-20, ClientRectangle.Y+10), sf); // In Border using

Android: How to use NumberPickerDialog

假如想象 提交于 2019-12-04 21:09:56
Could someone give me an example of how to instantiate a NumberPickerDialog within Activity.onCreateDialog ?( https://github.com/novak/numberpicker/blob/master/lib/src/com/michaelnovakjr/numberpicker/NumberPickerDialog.java ) ? There are examples in a repo called numberpicker-demo for using the widget, but none for the actual dialog. Amongst other approaches I've tried tried something like: return new NumberPickerDialog.Builder(this) .setTitle("Choose Number") .etc.. But this just shows a standard AlertDialog, without the NumberPicker. Thanks! Got it working eventually. There's an example in

WPF detect scrolling parent Control

只谈情不闲聊 提交于 2019-12-04 19:19:22
问题 Imagine the situation you open a WPF Popup (e.g. through ButtonClick ). You have a ListBox directly in the Popup with some items, so you have to be able to scroll. Imagine that this is your Custom Control and it's located in the ScrollViewer . Now if you move with your mouse outside from the Popup surface and scroll, what happens? You scroll up and down but with the Popup opened ! And that's the problem. The question is, how to detect from inside the Control, that some other unknown Parent

Winforms Designer: Modify (and keep) properties in sub objects

久未见 提交于 2019-12-04 19:04:25
For a WinForms control, I'd like to move certain settings into a sub object. One of them is a custom class containing all UI Strings, the other a OpenFileDialog: class MyControl: Control { // ... private OpenFileDialog m_dlgOpen = new OpenFileDialog(); public OpenFileDialog DialogOpen { get { return m_dlgOpen; } } } This adds the sub object to the designer, and allows to edit its properties (e.g. title, default extension, filter). However, the changes are nto added to the InitalizeComponent method, so they are lost. Is it possible to make this properties "persist" in the InitializeComponent

Android: Default attributes for custom views

青春壹個敷衍的年華 提交于 2019-12-04 19:00:36
问题 I have a custom view that extends one of the framework classes. Most View s in Android have some default attributes defined for them (such as Button being clickable, which is set by android:clickable="true" ). How do I provide application-wide defaults for my custom view? 回答1: I solved my own problem thusly: res/values/attrs.xml : <resources> <attr name="customViewStyle" type="reference" /> </resources> res/values/styles.xml : <resources> <style name="AppTheme" parent="@android:style/Theme

Create an ICommand Bindable property on Xamarin Forms

随声附和 提交于 2019-12-04 18:05:51
问题 I have a custom checkbox control that I created with an ICommand property and the corresponding bindable property (my checkbox is a Xamarin.Forms XAML Page), the code is: CheckBox.xaml <Image x:Name="imgCheckBox" WidthRequest="20" HeightRequest="20"/> <Label x:Name="lblCheckBox" TextColor="Black" VerticalOptions="CenterAndExpand"/> <TapGestureRecognizer Tapped="OnCheckBoxTapped"/> CheckBox.xaml.cs public partial class CheckBox : ContentView { private static ImageSource uncheckedImage; private

Set ClientRectangle in custom form in C#

别等时光非礼了梦想. 提交于 2019-12-04 17:04:31
In C# I have custom form of None border style which override onPaint event and draw custom background with transparency key. I want to set my own client rectangle value (so content would be placed inside my custom border), but unfortunally Form's ClientRectangle property is read-only. I found advice over net to override WndProc method (where it sets client size) but saddly, I found very little info about that. Especially it requires to fill data which are pointed by lParam and wParam and I really don't know how to do this in C#. Any help? Your question has a couple of things that concern me...

Styling a BlackBerry Application to Look Like an iPhone

♀尐吖头ヾ 提交于 2019-12-04 13:55:39
问题 I am porting an application from iPhone to BlackBerry. BlackBerry apps tend not to look as polished as iPhone, but naturally, I would like to maintain as much polish as I can, without breaking any important UI conventions. Are there any UI components that can help with this? NB. I am planning to follow all important UI conventions. For example, I will use the BlackBerry Menu instead of a tab bar for providing access to help and some other advanced options. Links Make BlackBerry UI Components