custom-controls

how to give textcolor to textview in class file

こ雲淡風輕ζ 提交于 2019-12-10 21:45:13
问题 I am creating the custom textview i want to give black textcolor to this textview. how can i set textcolor. my code is TextView textview = new TextView(this); textview.setText("Please follow this Description"); setContentView(_textview); when i use textview.setTextColor(Integer.parseInt("#000000")) Thanks in advance 回答1: Use Color.parseColor(): textview.setTextColor(Color.parseColor("#000000")); another option is to use HEX integer directly: textview.setTextColor(0xff000000); 回答2: I found the

UserControl vs CustomControl in C# [duplicate]

风格不统一 提交于 2019-12-10 16:16:21
问题 This question already has answers here : What is the difference between User Control, Custom Control and Component? (5 answers) Closed 6 years ago . What is the difference between UserControl and CustomControl in C# using WindowsForm? 回答1: There are custom and user controls for both windows applications and web applications. The windows application controls have a .cs extenstion. In a very general sense a user control is easier to create. You can drag existing controls like textboxes, labels,

same scroll bar for two richtextboxes

自闭症网瘾萝莉.ら 提交于 2019-12-10 16:02:14
问题 Is there any third party tool available which has two richtextboxes but only a shared scroll bar for both. I need to implement some text in two different languages but both the textboxes should scroll at the same time. 回答1: public enum ScrollBarType : uint { SbHorz = 0, SbVert = 1, SbCtl = 2, SbBoth = 3 } public enum Message : uint { WM_VSCROLL = 0x0115 } public enum ScrollBarCommands : uint { SB_THUMBPOSITION = 4 } [DllImport("User32.dll")] public extern static int GetScrollPos(IntPtr hWnd,

How to use a custom UIButton with Interface Builder?

送分小仙女□ 提交于 2019-12-10 14:39:53
问题 I have a subclass UIButton that loads a Nib: @implementation BlaButtonVC - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { NSArray *subViews = [[NSBundle mainBundle] loadNibNamed:@"BlaButton" owner:self options:nil]; [self addSubview:subViews[0]]; } return self; } @end And I can add this button to a view, like this: // ViewController.m BlaButtonVC *button = [[BlaButtonVC alloc] initWithFrame:CGRectMake(10, 10, 280, 44)]; button.titleXLabel.text = @"Nyuff";

how to make custom component property?

人盡茶涼 提交于 2019-12-10 13:22:48
问题 I need help to make a control property that when you click on it, it pop-up a custom dialog like settings. just like the TPicture. any Idea or suggestions? 回答1: If your class is used as a property of other components and you want to use the Object Inspector to invoke your dialog, then you have to implement and register a custom Property Editor, eg: interface uses DesignIntf, DesignEditors; type TMyClassProperty = class(TPropertyEditor) public procedure Edit; override; function GetAttributes:

Silverlight: TemplateBinding a Rectangle

倾然丶 夕夏残阳落幕 提交于 2019-12-10 12:00:31
问题 I'm having a heck of a time trying to template bind the StrokeThickness of a rectangle. My goal is to allow a user of my custom control to set a property called SelectedBorderThickness which will, in fact, set the StrokeThickness of a rectangle. I thought I understood templating but I guess I really don't. If I do this: <Rectangle x:Name="myRect" Height="100" Width="100" Stroke="Black" SelectedBorderThickness="5" /> Can someone please show me how to write the Style elements to get this to

control template visibility triggers

独自空忆成欢 提交于 2019-12-10 11:33:12
问题 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

Mvvm support for custom kendo ui widget

这一生的挚爱 提交于 2019-12-10 11:12:12
问题 A few days before I asked this question and got a really cool answer. Hereafter I wonder if I can use my custom widget as I use all standart kendo components by mvvm convention. And what parts of custom widget do I have to edit? For example: <div id="dropdowns" data-role="linkeddropdowns" data-period="YEAR" data-bind="year: selectedYear"></div> Thanks, 回答1: I think you may run into problems with the internal view model approach because Kendo UI tends to not be good about nesting view model

Creating custom RichTextBox control

不问归期 提交于 2019-12-10 10:58:59
问题 I believe am in need of creating custom RichTextBox in C#. One kind of like that: I admit it might not even have to be RichTextBox , but after some research I decided it's gonna be the easiest way. Functionality I need are icons at each row, checkboxes and text formatting. My program will process each line of the text and mark lines that are correct, incorrect, and strike out lines not necessary in further work, while showing line that's currently processed and allowing user to edit some

How to paint custom control on datagridviewcell?

*爱你&永不变心* 提交于 2019-12-10 10:52:19
问题 I want to host a custom control for datagridviewcell . the only good reference i have was http://msdn.microsoft.com/en-us/library/7tas5c80.aspx However, i want the cell to display my own usercontrol instead on public class CustomCell : DataGridViewTextBoxCell { protected override void Paint(System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string