custom-controls

ASP.NET simple custom control with two way binding

偶尔善良 提交于 2019-12-12 18:11:56
问题 I have custom control with two textboxes and one drop down list. I want to make it two-way data bound, so when I put it into ie. Details View control like this: <asp:MyCustomControl ID="MyId" runat="server" Value1='<%# Bind("val1") %>'> </asp:MyCustomControl> then it should work like regular TextBox.. In my control I have Value1 defined: [ Bindable(true, BindingDirection.TwoWay), Browsable(true), DefaultValue(0), PersistenceMode(PersistenceMode.Attribute) ] public double Value1 { get { if

WPF Transformations — Rotating and switching width/height?

南笙酒味 提交于 2019-12-12 17:29:52
问题 Basically, I have a FooControl (I did not set the Height/Width explicitly) added to a Grid . <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <FooControl x:Name="HWFoo" Content="HelloWorld" Grid.Row="0"> <FooControl.RenderTransform> <TransformGroup> <RotateTransform Angle="270" /> <TranslateTransform Y="{Binding ActualWidth, ElementName=HWFoo}" /> </TransformGroup> </FooControl.RenderTransform> </FooControl> </Grid> But, the problem now is that the

Creating custom button class in Android

两盒软妹~` 提交于 2019-12-12 17:08:50
问题 I'm trying to create custom button class for my android app public class TicTacButton extends Button I've set all the constructors inside the TicTacButton and created custom methods and properties. In my main activity, I've tried to initialize the Buttons as TicTacButton btn = (TicTacButton) findViewById(R.id.button1); I'm getting a java.castClassException. android.widget.Button cannot be cast to com.example.tictactoetitan.TicTacButton I tried changing my xml file as <TicTacButton android:id=

How do I make my custom treeview accept the Enter key?

别等时光非礼了梦想. 提交于 2019-12-12 16:01:59
问题 I've got a custom control that descends from TTreeView. I'm trying to give it special behavior when the user presses ENTER while the control is focused, by giving it a WM_CHAR handler that responds to VK_RETURN, but it never gets called. I tried making sure that it would accept all keyboard input by adding a WM_GETDLGCODE handler that says msg.Result := msg.Result or DLGC_WANTALLKEYS; . Now it receives the ENTER key, but the arrow keys no longer work! Anyone have any idea how I can fix this

User Control custom properties lose state when user control is rebuilt

萝らか妹 提交于 2019-12-12 14:27:12
问题 I have a user control with custom properties as follows: [DefaultValue(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] [Description("Gets or sets whether the \"Remove\" button is visible.")] public bool ShowRemoveButton { get { return this.removeButton.Visible; } set { this.removeButton.Visible = value; } } The control contains a standard button control. This property is used to show or hide the button. The user control is built in a separate project assembly

How to override UserControl class to draw a custom border?

て烟熏妆下的殇ゞ 提交于 2019-12-12 13:33:46
问题 I would like to override System.Windows.Forms.UserControl to draw a custom border (e.g. using custom color). It's not possiblу to do usign built-in classes, because the only method/property you can affect the border behavior is BorderStyle. Overriding OnPaint the following way (code below) is not a good solution, because it's basically drawing another border on top of original one. protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (this.BorderStyle == BorderStyle

Swift UITableViewCell Alignment

。_饼干妹妹 提交于 2019-12-12 11:50:30
问题 I am trying to display a page like the following page title (left align) region name(center align) people in the region(subtitle with email in the detail label) But if I choose subtitle as cell style, everything will be left aligned and I cannot change them in the code. Then If I choose custom as style the detailtextlabel will not show. if(poDetailList.LastName == "POName"){ cell.backgroundColor = SharedClass().coopGroupHeaderColor let selectedColor = UIView() selectedColor.backgroundColor =

iOS - Getting a weird error: unrecognized selector sent to instance on a UITableView

爷,独闯天下 提交于 2019-12-12 11:24:35
问题 Introduction In my current application I have a UITableView which holds custom cell objects. The custom UIViewCellObjects are simply subclassed from the standard UITableViewCell class. The custom cells holds information about running background uploads, and updates them with things like percentage done and so on. The custom cell objects listens to NSNotifications from upload processes running in the background, and when they get a relevant notification, they simply update their own view

UIView animation not working when used with DCRoundSwitch

别说谁变了你拦得住时间么 提交于 2019-12-12 10:23:50
问题 I have done following code for animation inside a selector method of custom UISwitch DCRoundSwitch. if ([[[App.remindersArray objectAtIndex:0] objectAtIndex:3]isEqualToString:@"YES"]){ [firstReminderOnOffButton setSelected:YES]; [swtchDailyReminder setOn:YES]; imgviewDailyReminder.image=[UIImage imageNamed:@"nDailyReminder_On_1.png"]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.35]; [UIView setAnimationDidStopSelector:@selector(animateFadingIn)]; [UIView

Custom Control in WPF as necessary as in Winforms?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 10:14:49
问题 During an interview, the company was asking about my use of custom controls in WPF. I have found with all of the power of the WPF way of creating a control (datatemplate, control template, styles,triggers etc... ) that having to write a custom control that overrides the OnRender method really hasn't been necessary. Later found out that most of their development has been in Winforms. If coming at a control from a 100% WPF direction, how often is it necessary to write a customcontrol with