custom-controls

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

帅比萌擦擦* 提交于 2019-12-06 14:00:46
问题 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

Best practice approach for scrollable control in C# .NET

我是研究僧i 提交于 2019-12-06 13:21:10
I am designing a windows forms control for Syntax Editing. I know there are already a lot out there, like Scintilla , FastColoredTextBox , Actipro Syntax Edito r, Avalon Edit etc. I have reasons for designing my own, so that's not the issue. So far I have been designing the look and feel of the control. It will need to be able to control vertically, and horizontally. The options I have come across are: My control extends ScrollableControl or ContainerControl My control instantiates a HScrollBar and VScrollBar control and places them accordingly My control uses ScrollBarRenderer to custom draw

BlackBerry - Invoke a click event on bitmap Field

帅比萌擦擦* 提交于 2019-12-06 11:49:15
can anyone help me for solving the below question. I am making an application for blackberry in that from one bitmapField i have to invoke a new screen by clicking on the bitmapField. I want the code for the same... how to invoke a new screen by clicking on a bitmapField... and i am using blackberry JDE 4.7 Try making the BitmapField focusable BitmapField bm = new BitmapField(bitmap, BitmapField.FOCUSABLE); This might help Swati BitmapField bmpField = new BitmapField(bitmap, BitmapField.FOCUSABLE) protected boolean navigationClick(int status, int time) { if(bmpField.isFocus) { UiApplication

set the font of a custom label added on a custom dialog page in nsis installer

£可爱£侵袭症+ 提交于 2019-12-06 10:43:10
how to set the font of a label added on a custom added page in nsis installer To create the label i have used this : nsDialogs::Create 1018 var Label ${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:" Pop $Label !include nsDialogs.nsh var Label page custom pre function pre nsDialogs::Create 1018 ${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:" Pop $Label CreateFont $0 "Arial" 18 SendMessage $Label ${WM_SETFONT} $0 1 nsDialogs::Show functionend 来源: https://stackoverflow.com/questions/5894473/set-the-font-of-a-custom-label-added-on-a-custom

Problem with drawing custom Windows controls

北城余情 提交于 2019-12-06 09:05:12
问题 I'm playing around with drawing my own custom controls using the uxTheme library in Windows, and I can't work out why my control doesn't look like the regular Windows control that (supposedly) uses the same theme I'm using: The above image shows a standard Windows ComboBox (top) and my custom control drawn using the ComboBox theme (bottom). What I can't work out is why the border from my control is a different shape and colour to the standard control. In my class constructor I open the theme

Can we create a circular uitableview in iphone program?

落爺英雄遲暮 提交于 2019-12-06 08:54:18
Can we create a Circular/ Rounded Shape UITableview ? I know that we can rounded the corners of table view or by transform we can rotate table view but is need UITableview to scroll in clock wise or anti-clock wise direction. Can we use some other custom control to implement this. Check these links.. https://www.cocoacontrols.com/controls/circleview and https://iphone2020.wordpress.com/tag/circular-tableview/ . It may help you. For anybody who has trouble with the above links, you can get the code directly from GitHub here https://github.com/bharath2020/UITableViewTricks . It is a drag and

WPF Custom Control's ToolTip MultiBinding problem

一笑奈何 提交于 2019-12-06 08:51:40
When I set a ToolTip Binding In a WPF Custom Control, this way it works perfect: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... SetBinding(ToolTipProperty, new Binding { Source = this, Path = new PropertyPath("Property1"), StringFormat = "ValueOfProp1: {0}" }); } But when I try to use MultiBinding to have several properties in the ToolTip, it doesn't work: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... MultiBinding multiBinding = new MultiBinding(); multiBinding.StringFormat = "ValueOfProp1: {0}\nValueOfProp2: {1}\nValueOfProp3: {2}\n"; multiBinding

Propagate event from custom control to form

旧城冷巷雨未停 提交于 2019-12-06 07:51:05
问题 I have a custom control like: public sealed class BorderEx : Control { public static readonly RoutedEvent ReloadClickEvent = EventManager.RegisterRoutedEvent("ReloadClick", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BorderEx)); public event RoutedEventHandler ReloadClick { add { AddHandler(ReloadClickEvent, value); } remove { RemoveHandler(ReloadClickEvent, value); } } void RaiseReloadClickEvent() { var newEventArgs = new RoutedEventArgs(ReloadClickEvent); RaiseEvent

Approach to make a custom tabBar

ⅰ亾dé卋堺 提交于 2019-12-06 07:27:38
问题 What should be the best way to create a effect like this and the handling of navigation controllers and view controllers ... what to do if I don't want to re-size each subsequent view in viewcontorller and things appear as if it is a tabBar 回答1: I would recommend using an UIImageView for the blue background, then 5 UIButtons of custom type with PNG images for the actual buttons. Subclass UIView and put all the code to set up the background and buttons in the init function. That way you can

control template visibility triggers

别来无恙 提交于 2019-12-06 07:21:40
All I am trying to do with the button style below is have the button only be visible when either IsMouseOver or IsPressed. The way it's written won't even compile, not finding "Glyph". How can I clean this up to the button is visible when IsMoueOver? Cheers, Berryl <Style x:Key="EditCommandButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Content"> <Setter.Value> <TextBlock x:Name="Glyph" Width="30" FontFamily="Wingdings 3" FontSize="24" Text="a" Visibility="Hidden"/> </Setter.Value> </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}">