Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to create custom control in watch at wpf
Posted

This is how:
C#
type MyControl : System.Windows.Controls.Control
{
    // add the code you want here
}

Please see:
https://msdn.microsoft.com/en-us/library/system.windows.controls.control%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/vstudio/ms745025%28v=vs.100%29.aspx[^].

—SA
 
Share this answer
 
Comments
Member 11823120 9-Aug-15 14:31pm    
I have created custom control clock in Generic.xaml in custom control library.I designed that hourhand,minutehand and secondhand in Rectangle shapes.
If user need to change elipse shape means user can change property name value rectangle to elipse in mainwindow.xaml

how can change Rectangle to elipse shape?
Sergey Alexandrovich Kryukov 9-Aug-15 21:32pm    
I answered by Solution 3.
—SA
Member 11823120 asked:
How can change Rectangle to ellipse shape?
This is a very special feature. It can be easily achieved by assigning some non-rectangular instance of Geometry to the property Clip>^],
https://msdn.microsoft.com/en-us/library/system.windows.media.geometry(v=vs.110).aspx[^] (please see the code sample here),
https://msdn.microsoft.com/en-us/library/ms751808%28v=vs.100%29.aspx[^].

—SA
 
Share this answer
 
v2
I have created custom control clock in Generic.xaml in custom control library.I designed that hourhand,minutehand and secondhand in Rectangle shapes.
If user need to change elipse shape means user can change property name value rectangle to elipse in mainwindow.xaml
how can change Rectangle to elipse shape?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Aug-15 21:24pm    
Sorry, this is not an answer. Such posts are considered as abuse, so better remove it, to avoid down-voted and abuse reports. Instead, use comments to existing posts.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900