Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Thursday, 4 September 2014

WPF : Effective Tool tip text for Label control

<Label Grid.Row="2" Grid.Column="0" Cursor="Hand">
            ClassFunda Examhall
            <Label.ToolTip>
                <ToolTip Background="White" HasDropShadow="False">
                    <StackPanel>
                        <TextBlock>
                        Peoduct Of BeanMatrix Info Services Private Limited
                        </TextBlock>
                        <Image Height="70">           <Image.Source>http://www.beanmatrix.com/images/BeanMatrix.png</Image.Source>
                        </Image>
                        <Border Width="1" BorderBrush="Gray"></Border>
                    </StackPanel>
                </ToolTip>
            </Label.ToolTip>

        </Label>

__________________________________________________________________________________
Output


WPF : Grid layout demo for spiting window screen partition

<Grid ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition ></ColumnDefinition>
        </Grid.ColumnDefinitions>

</Grid>

_____________________________________________________________________________

split window in three row with first row has 100 px height and last row has 30 px height and middle row contain rest of all part of screen 
_____________________________________________________________________________

<Grid ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition ></ColumnDefinition>
            <ColumnDefinition ></ColumnDefinition>
        </Grid.ColumnDefinitions>

</Grid>

______________________________________________________________________________

Evenly split window screen into four part has two row and each row as two column
______________________________________________________________________________

<Grid ShowGridLines="True">
<Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
       </Grid.RowDefinitions>
       <Grid.ColumnDefinitions>
            <ColumnDefinition Width="7*"></ColumnDefinition>
            <ColumnDefinition Width="2*"></ColumnDefinition>
       </Grid.ColumnDefinitions>      
</Grid>
_______________________________________________________________________________

spit window in two column, column 1 has 7X width and column 2 has 2X width where X is multiple for screen spiting element work like as percentage  
_______________________________________________________________________________


  

WPF : how to run window application in maximize form

It is very simple just add WindowState="Maximized" in window tag 


<Window x:Class="ObjDataProvider.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" WindowState="Maximized">