<UniformGrid>

<Button Click="Button_Click">확인</Button>

<!--popupAnimation : 사라지는효과/ placement : 나타나는 위치/ AllowsTransparency : 배경투명-->

<Popup PopupAnimation="Fade" Placement="Mouse" Name="popup1" AllowsTransparency="True">

<!--테두리 감싸는 속성-->

<Border Padding="10" BorderThickness="1" CornerRadius="20" BorderBrush="Red" Background="White"> <TextBlock>테스트</TextBlock>

</Border>

</Popup>

 

<MediaElement Width="160" Height="120" Name="media1"></MediaElement><!--Media재생용-->

 

<StackPanel>

<Button Click="Button_Click_1">재생</Button>

<Button Click="Button_Click_2">멈춤</Button>

</StackPanel>

</UniformGrid>

 

 


 

이벤트 

private void Button_Click(object sender, RoutedEventArgs e)//button클릭

{

if (popup1.IsOpen)

popup1.IsOpen = false;

else

popup1.IsOpen = true;

}

 

private void Button_Click_1(object sender, RoutedEventArgs e)//미디어재생용 (시작)

{

media1.Source = new Uri(@"D:\[06]WPF\dh.wmv"); //소스 경로지정

media1.LoadedBehavior = MediaState.Manual;

media1.Play();

}

 

private void Button_Click_2(object sender, RoutedEventArgs e)//미디어재생용 (멈춤)

{

media1.Stop();

}

 


 

by 피요히코~ 2009. 2. 25. 12:53
| 1 |