일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- python
- Django-allauth
- SQL
- for loop
- numpy
- flask
- array
- graphene-django
- FastAPI
- Django
- check_password
- GraphQL
- allauth
- tkinter Radio 동적버튼
- Today
- Total
객
[vb 2008 ] 구구단 프로그램예제 본문
Class Window1
'WPF 두번째 예제 프로그램
'프그램명 : 구구단 프로그램
'제 작 일 : 2010. 01. 02
Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Me.Title = "< 구구단 프로그램 >"
TextBox1.Text = ""
Button1.Content = " 확 인 "
Button2.Content = " 종 료 "
Label1.Content = ""
TextBox1.Focus()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
Dim a As Integer
Label1.Content = ""
If IsNumeric(TextBox1.Text) = False Then
Label1.Content = "숫자 입력만 가능 합니다."
Exit Sub
Else
a = TextBox1.Text
End If
Call kubsum(a)
End Sub
Private Sub kubsum(ByVal a As Integer)
Dim i As Integer = 1
Dim c As Integer = 0
For i = 1 To 9
c = CInt(a) * i
Label1.Content = Label1.Content & a & " * " & i & " = " & c & vbCrLf
Next
End Sub
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles TextBox1.KeyDown
Dim a As Integer
Label1.Content = ""
If e.Key = Key.Enter Then
If IsNumeric(TextBox1.Text) = False Then
Label1.Content = "숫자 입력만 가능 합니다."
Exit Sub
Else
a = TextBox1.Text
End If
Call kubsum(a)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button2.Click
Me.Close()
End
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="342" Width="300">
<Grid>
<Grid Margin="8,9,8,16" Name="Grid1" ForceCursor="False" ShowGridLines="False" OverridesDefaultStyle="True">
<Grid.RowDefinitions>
<RowDefinition Height="29*" />
<RowDefinition Height="217*" />
<RowDefinition Height="27*" />
<RowDefinition Height="6*" />
</Grid.RowDefinitions>
<Button HorizontalAlignment="Right" Margin="0,0,18,0" Name="Button1" Width="87">Button</Button>
<TextBox Margin="31,5,0,1" Name="TextBox1" TextAlignment="Center" HorizontalContentAlignment="Center" Foreground="Blue" HorizontalAlignment="Left" Width="70" />
<Label Grid.Row="1" Margin="4,6,6,0" Name="Label1" Grid.RowSpan="2" Foreground="Blue">Label</Label>
<Button Grid.Row="2" HorizontalAlignment="Right" Margin="0,0,18,0" Name="Button2" Width="84">Button</Button>
<Label Margin="100,3,0,0" Name="Label2" HorizontalAlignment="Left" Width="24" Height="29" Grid.RowSpan="2" VerticalAlignment="Top">단</Label>
</Grid>
</Grid>
</Window>
'[PL] > VB & VB.NET' 카테고리의 다른 글
[ vb 2008 ] 윈도우폼 사이즈변경 예제 (0) | 2010.01.03 |
---|---|
Model-View-ViewModel 디자인 패턴을 사용한 WPF 응용 프로그램 (0) | 2010.01.02 |
[ vb 2008 ] WPF 예제 (0) | 2010.01.02 |
[ vb 2008 ] ImageList 예제 (0) | 2010.01.01 |
[ vb 2008 ] 사용자 컨트롤 매핑 (0) | 2009.12.31 |