일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- flask
- array
- FastAPI
- tkinter Radio 동적버튼
- Django
- allauth
- for loop
- check_password
- GraphQL
- python
- numpy
- SQL
- graphene-django
- Django-allauth
- Today
- Total
객
[ vb 2008 ] 윈도우폼 사이즈변경 예제 본문
Imports System.Windows
Class Window1
Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Call winFormSetting()
End Sub
Private Sub winFormSetting()
Me.Title = "폼 사이즈"
Button1.Content = "확 인"
Label1.Content = ""
Label2.Content = ""
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
Dim We As Single
Dim He As Single
We = Window1.Width
He = Window1.Height
Label1.Content = "Width : " & We
Label2.Content = "Height : " & He
End Sub
End Class
XAML Source :
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Name="Window1">
<Grid>
<Grid Margin="-1,0,0,0" Name="Grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="93*" />
<ColumnDefinition Width="93*" />
<ColumnDefinition Width="93*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="98*" />
<RowDefinition Height="38*" />
<RowDefinition Height="40*" />
<RowDefinition Height="61*" />
<RowDefinition Height="25*" />
</Grid.RowDefinitions>
<Button Grid.Column="1" Grid.Row="4" Name="Button1">Button</Button>
<Label Margin="0,3,0,2" Name="Label1" HorizontalContentAlignment="Center" Grid.Row="1" Grid.Column="1" FontSize="15">Label</Label>
<Label Margin="0,4,0,3" Name="Label2" HorizontalContentAlignment="Center" Foreground="Black" Grid.Row="2" Grid.Column="1" FontSize="15">Label</Label>
</Grid>
</Grid>
</Window>
'[PL] > VB & VB.NET' 카테고리의 다른 글
[ vb 2008 ] 모니터 해상도 구하기 (0) | 2010.01.05 |
---|---|
[vb 2008 ] 슬라이더 예제 (0) | 2010.01.03 |
Model-View-ViewModel 디자인 패턴을 사용한 WPF 응용 프로그램 (0) | 2010.01.02 |
[vb 2008 ] 구구단 프로그램예제 (0) | 2010.01.02 |
[ vb 2008 ] WPF 예제 (0) | 2010.01.02 |