C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » WPF »

Wpf


Posted Date: 03 Nov 2009      Posted By: p.karthikeyan      Member Level: Silver     Points: 1   Responses: 1



how to create WPF usercontrol and show to WPF form ?




Responses

Author: K Hari Prasad    03 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

First Create the UserControl:

<UserControl x:Class="WpfApplication1.ButtonUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<Grid>
<Button Name="btnOk" Height="20" Width="100" Content="OK"></Button>
</Grid>
</UserControl>

Second : reference the above user control like below and use it.

<Window x:Class="WpfApplication1.Window5"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="Window5" Height="300" Width="300">
<Grid>
<local:ButtonUserControl></local:ButtonUserControl>
</Grid>
</Window>



Post Reply
You must Sign In to post a response.
Next : Webbrowsercontrol
Previous : Adding style or template to my buttom.
Return to Discussion Forum
Post New Message
Category: WPF

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use