custom-controls

Custom Shaped Button in WPF [closed]

痴心易碎 提交于 2019-11-28 13:35:22
I have a requirement of creating a button which takes the shapes as displayed in the picture: Can anyone please help me? Thanks in advance! You could use a ControlTemplate to achieve that: <Style x:Key="ButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Background" Value="Black"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Path Fill="{TemplateBinding Background}" Data="M 0,0 A 100,100 90 0 0 100,100 L 100,100 100,0" /> </ControlTemplate> </Setter.Value> </Setter> </Style> Than you apply it to the button: <Button Style="{StaticResource

Image flickers on repaint()

江枫思渺然 提交于 2019-11-28 12:46:15
I figured out the solution for my previous question which landed me into new problem. In the following code im moving an image around a JFrame using arrow keys. but every time i press an arrow key the image seems to flicker which is quite noticeable when a key is pressed continuously. import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JFrame; public class TestProgram extends JFrame implements KeyListener { private BufferedImage TestImage;

Animated Glow Effect for Button - C# Windows Forms

。_饼干妹妹 提交于 2019-11-28 11:44:34
I want to apply animation to my button when pressing button. In WPF I can use Storyboard with triggers to create animation. Here is an example: <Storyboard x:Key="AniOpacityDelay"> <DoubleAnimation Storyboard.TargetName="background" Storyboard.TargetProperty="Opacity" AutoReverse="True" To="0.65" Duration="0:0:0.2"/> </Storyboard> and: <ColorAnimationUsingKeyFrames Storyboard.TargetName="Itemcont" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)"> <EasingColorKeyFrame KeyTime="0" Value="#EEEEEE"/> </ColorAnimationUsingKeyFrames> Windows Forms doesn't have Storyboard

How to creating EmptyDataText for DataGridView in Windows Application

六月ゝ 毕业季﹏ 提交于 2019-11-28 11:38:38
Today i am facing problem to show/hide label according to data source. If the data source has no row then i would like to set "No Data Found" else display number of records in winforms application . This would be possible in Asp.net like: <emptydatatemplate> No Data Found </emptydatatemplate> OR EmptyDataText=" No Data Found" But I would like in Windows Application . Please help me if you have any solution for the same. Any solution would be appreciated! Thanks, Imdadhusen imdadhusen One way you could accomplish this is to use the Paint() event to check the rows and if there are none, then

How to place buttons over Image in android?

ぃ、小莉子 提交于 2019-11-28 10:57:54
I want to create a custom view like this. I tried the following <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" > <ImageView android:id="@+id/customView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/sample_image" /> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|top"

Styling browser-native video controls

纵然是瞬间 提交于 2019-11-28 10:48:14
Is it possible to cross-browser style the controls of a browser-native video such as video from HTML5's video tag? I do not understand if it is possible or not, I can't find anything other than this article but it seem uses Javascript. I would like to make the controls bar fit the video width; as you can see from the image attached, the controls bar excedes the video width. HTML for the above image <div class="video centered-content"> <a class="circle-canvas close-video" href="javascript:void(0)" id="video-close" rel="tooltipTOP" data-original-title="close">X</a> <video width="63%" height="60%

Custom Control - Clickable link in properties box

孤者浪人 提交于 2019-11-28 10:37:34
I'm making a custom control using C#, and I need to add a link to the property box(so I can show a form once it's clicked). Here's an example: You are looking for DesignerVerb . A designer verb is a menu command linked to an event handler. Designer verbs are added to a component's shortcut menu at design time. In Visual Studio, each designer verb is also listed, using a LinkLabel, in the Description pane of the Properties window. You can use a verb for setting value of a single property, multiple properties or for example for just showing an about box. Example: Create a designer for your

Is it possible to write your own objects that give out ActionEvents?

只谈情不闲聊 提交于 2019-11-28 10:31:41
问题 I've looked at the java tutorials online and they all seem concerned with catching ActionEvents given out by other components that are already written. Is it possible to write your own objects that have there own set of criteria that trigger actionEvents that can then be caught by other classes that have registered as listeners? So for example: If I wanted an object that was counting sheep to send out an actionEvent when 100 sheep had been counted to all the sleeper objects that had

how to create custom tableViewCell from xib

对着背影说爱祢 提交于 2019-11-28 10:11:33
I want to create a custom TableViewCell on which I want to have UITextField with editing possibility. So I created new class with xib. Add TableViewCell element. Drag on it UITextField. Added outlets in my class and connect them all together. In my TableView method cellForRowAtIndexPath I create my custom cells, BUT they are not my custom cells - they are just usual cells. How can I fix this problem, and why it is? thanx! //EditCell. h #import <UIKit/UIKit.h> @interface EditCell : UITableViewCell { IBOutlet UITextField *editRow; } @property (nonatomic, retain) IBOutlet UITextField *editRow;

ScrollBars are not visible after changing positions of controls inside a Canvas

只愿长相守 提交于 2019-11-28 10:01:18
问题 I created a custom canvas control inheriting from WPF Canvas . I am using it like this in main window - <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <RTD:RTDesignerCanvas Margin="5" Background="White" x:Name="canvas1" Focusable="True" AllowDrop="True"> </RTD:RTDesignerCanvas> </ScrollViewer> Everything works fine but when I try to set the position of controls inside it like this Canvas.SetTop(item, 200); scrollbars are not visible and control is