custom-controls

Drawing a blinking caret in Winforms

家住魔仙堡 提交于 2019-12-01 13:01:41
I'm developing a custom control, which most resembles a text area. I am drawing text, which works correctly, and accepting input which also works.. But I (the user) am left guessing where the caret is while I type, since I'm doing everything manually. How do I draw a blinking caret to show where I am currently typing? Is there a standard way to do this? ChrisW I think that, annoyingly, there is no managed API for Carets. You must, therefore, either PInvoke to the Win32 functions for carets, or, implement that functionality yourself (i.e. painting and hiding a blinking caret, when and only when

WPF How to create a Custom Textbox with validation and binding

冷暖自知 提交于 2019-12-01 12:39:05
问题 I'm developing a custom text box for currency editing. I've seen some ready to use ones, but they're complicated and/or not really usable, forcing you to bad practices (such as hard coding the name that's supposed to be used on the control). So I've decided to do it myself, but I'm having trouble to work with the binding options, since the property assigned to the binding attribute must be a decimal, but the Text property of the TextBox control accepts strings. The answer I thought was, maybe

Center subitem Icon in ListView

十年热恋 提交于 2019-12-01 12:25:43
问题 I would like to center the icon in one of my columns. The way I currently add icons is by calling the AddIconToSubitem method after the row has been created. How would I modify my custom control to also center the icon? Thanks Public Class ListViewSubIcons : Inherits System.Windows.Forms.ListView Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer Public Declare

Blackberry - custom BubbleChartField

♀尐吖头ヾ 提交于 2019-12-01 11:54:28
I need to develop a blackberry application which should show a bubble chart. How to implement custom control for this purpose? thanks. UPDATE here is the KB How To - Create graph fields You should be more specific and complete in you question... Well, just to show you direction: public class BubbleChart extends Field { int mWidth = Display.getWidth(); int mHeight = Display.getHeight(); int[] mXpos = null; int[] mYpos = null; int[] mRad = null; int[] mColor = null; public BubbleChart(int[] xPos, int[] yPos, int[] rad, int[] colors) { this(xPos, yPos, rad); mColor = colors; } public BubbleChart

Modify default HTML5 video controls

回眸只為那壹抹淺笑 提交于 2019-12-01 11:12:28
问题 I have a rather unusual question for you all; it might be foolish but I am new to this area and I would really appreciate some help. As the title suggests I was wondering if there is a way to disable a specific button from the default browser controls for the HTML5 video. I know that each browser has its own somewhat unique looking set of controls so I don't think that I can overlay the button with CSS . If it is impossible is it maybe possible to somehow tie via Javascript the event of the

Bind to wpf custom control dependency property for tooltip?

二次信任 提交于 2019-12-01 10:57:14
问题 I have a custom control I wrote in WPF, which has a Boolean dependency property: public static readonly DependencyProperty IsAlertProperty = DependencyProperty.Register("IsAlert", typeof(bool), typeof(AlertControl), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.None, OnIsAlertChanged, null, false, UpdateSourceTrigger.PropertyChanged)); public bool IsAlert { get { return (bool)GetValue(IsAlertProperty); } set { SetValue(IsAlertProperty, value); } } In my Generic

Blackberry - custom BubbleChartField

点点圈 提交于 2019-12-01 10:46:59
问题 I need to develop a blackberry application which should show a bubble chart. How to implement custom control for this purpose? thanks. 回答1: UPDATE here is the KB How To - Create graph fields You should be more specific and complete in you question... Well, just to show you direction: public class BubbleChart extends Field { int mWidth = Display.getWidth(); int mHeight = Display.getHeight(); int[] mXpos = null; int[] mYpos = null; int[] mRad = null; int[] mColor = null; public BubbleChart(int[

WP8 how to create base-page & use it

半世苍凉 提交于 2019-12-01 08:27:42
I've googled, but did not get any useful resources, so i decided to ask. Problem : I have a Windows Phone 8 C#/XAML .NET 4.5 Application , that is going to have several pages ( 15 - 50 ) that are all going to have similar look + same datacontext set to one instance of ViewModel : -------------------------- |logo usermenu(v)| -------------------------- | | | | | | | ..variable.. | | ..content... | | | | | -------------------------- Question : I can't find anything usable in this matter, could someone explain how to do it? (I'm a rookie - meaning that I'm grateful for any useful information, but

How to set description for my Custom Control to show in ToolBox?

佐手、 提交于 2019-12-01 08:22:00
I want to add a text that tells the designer what my control is into my custom control when it is in design time. Like VS default controls in here: I have tried ///summary but it didn't work for me. How can it be done? You can decorate your class with Description attribute. Then when you add the control to toolbox using Choose Items ... or using a vsix package, the description will be shown as a tooltip for your control: [Description("Some Description")] public partial class UserControl1 : UserControl { } 来源: https://stackoverflow.com/questions/36144777/how-to-set-description-for-my-custom

Create a Custom Control with the combination of multiple controls in WPF C#

若如初见. 提交于 2019-12-01 08:11:45
I wish to create a Custom Control, it should be a combination of predefined controls like Textbox, Button, ListBox, etc., Kindly refer the following Controls (Just a Sample) <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="50" /> </Grid.RowDefinitions> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="300" /> <ColumnDefinition Width="100" /> </Grid.ColumnDefinitions> <TextBox Grid.Column="0" /> <Button Grid.Column="1" Content="Add" Margin="20,0" /> </Grid> <ListBox ItemsSource="{Binding textBox}" Grid.Row="1" Margin="0,25"> <ListBoxItem /> </ListBox> </Grid> I