custom-controls

Swift Cocos2d3.x CCSprite applyImpulse not giving proper jump

坚强是说给别人听的谎言 提交于 2019-12-25 06:56:23
问题 I am using Cocos2d3.x with SpriteBuilder in Swift language. I want to make some animation like bouncing ball on Polls as seen in this GIF: https://www.dropbox.com/s/43vwlbjoazaxe7u/jumpyBall_15_jul_15.gif?dl=0 If you have noticed in the GIF file, each second jump is half of the previous jump. So, it seems pattern of 1,0.5,1,0.5,1,0.5,... Following are my settings: Polls: Physics Enabled Density: 1.0 Static Body Collision Type: Platform Circle: Physics Enabled Density: 1.0 Dynamic Body

Can Windows manage multiple focus points on a single control?

北城以北 提交于 2019-12-25 05:36:13
问题 I'm building a custom control which is to have multiple focus points. For example, within 1 control, let's say there's 3 regions (could be defined as a rect on the canvas) which are to be able to have focus. Depending on which one has focus, I don't want the default Windows dotted line around it, but some special handling. I know nothing about how to even give 1 custom control its own focus. The original project was a single TPanel with a few VCL controls on it, each of course being its own

C# custom control - Redraw after changing a member object's properties

巧了我就是萌 提交于 2019-12-25 05:08:34
问题 C# - .Net4.0, Visual Studio 2010 For certain reasons I'm using a separate class to store some of my custom control's properties (properties to do with drawing a grid). This is causing some problems, since I'd like to be able to call "Invalidate()" any time these values are edited (either via the properties window, or during run-time), to automatically redraw the control. The best solution I could think of was to implement INotifyPropertyChanged within my "GridProperties" class, fire off a

.NET 2010 custom control, multiline String property to be edited in the designer

旧城冷巷雨未停 提交于 2019-12-25 04:43:09
问题 I'm writing a custom control and I want to add a "MessageText" property of type String: <Browsable(True), DefaultValue(""), Category("CustomControls"), Description("Blah."), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> Public Property MessageText As String The MessageText property is a multiline text, and the user must be able to set the text using the designer. The problem is that the designer doesn't allow to enter a newline directly for a string property. I

Custom Control Styling/Triggers

隐身守侯 提交于 2019-12-25 04:04:12
问题 I'm trying to make a custom control that consists of several buttons and a couple labels, but the buttons are supposed to be invisible, showing only the content within them. I can get rid of the border, background, etc by setting them to Transparent. But whenever I MouseOver them the default windows hover effect shows the whole button again. I've tried numerous guides on custom controls, but ultimately cannot figure out how to override this. Basically my questions boil down to, how much of

How to make events for changing custom made properties (custom control)

我怕爱的太早我们不能终老 提交于 2019-12-25 03:06:54
问题 I have custom control inheriting from TextBox class , and i have added some properties , for example i have property placeHolderText and i want to have some event which will occur when i change that text? Like these events And there is my property in designer view How to achieve that? 回答1: To create an event in C# you can follow Standard .NET event patterns. To create a Changed event for a Something property of a custom control, you can follow these steps: Declare an event SomethingChanged .

Disabling Button with custom Content in Silverlight?

爱⌒轻易说出口 提交于 2019-12-25 02:57:15
问题 What is the easiest way to create a Silverlight Button with custom Content which knows how to ' look ' disabled? I.e. if you set IsEnabled="False" it will look greyed out. The custom Content will be dead simple, text and an image. I have done this before in a WPF application quite easily by setting the Content to a StackPanel containing a TextBlock and an Image. I then implemented a Style Trigger on the Image to change it to a greyed out version when it wasn't enabled. The text changed colour

Buttons on click event, inside an update panel, rendered through a custom server control not firing

泪湿孤枕 提交于 2019-12-25 02:55:31
问题 I am developing a custom control which renders (a) textbox (es), in its textchange event I want to asynchronously send the value to the control where it would search and make the data available in an exposed property to be fetched later on page load . But my problem is, HOW TO ASYNCHRONOUSLY CALL A METHOD CODED INSIDE MY CONTROL to do the search functionality. For now, the textbox textchange and the buttons click events are not firing, the button click loads the page and writing in the

Color Picker Combo Box

帅比萌擦擦* 提交于 2019-12-25 02:37:29
问题 I want to customize my combobox each item, same as font, background, etc. Is there any simple way to set custom background color of each Combobox item? 回答1: This is simple example to do that. In this example my combobox has some item same as color name (Red, Blue, etc) and change the background of each item from this. Just flow the steps: 1) Set the DrawMode to OwnerDrawVariable : If this property set to Normal this control never raise DrawItem event ComboBox1.DrawMode = System.Windows.Forms

How to expose events in a WinForms custom control

扶醉桌前 提交于 2019-12-25 02:21:30
问题 I've developed a custom control that acts like a group box with a check box over the group label. The idea being, once the check box is unchecked all the controls in the group are disabled. I need to expose the Check changed event so that external actions could be performed if required. I've also exposed the Check state changed. Currently, when the control is used it changes the check state when any of the controls in the group loose focus. When I handle the check changed event, should I then