VERSION 5.00
Begin VB.Form frmLiczenie 
   Caption         =   "Program matematyczny"
   ClientHeight    =   3555
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4935
   LinkTopic       =   "Form1"
   ScaleHeight     =   3555
   ScaleWidth      =   4935
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdStart 
      Caption         =   "&Start"
      Height          =   372
      Left            =   1980
      TabIndex        =   6
      Top             =   1920
      Width           =   972
   End
   Begin VB.OptionButton optDziel 
      Caption         =   "Dzielenie"
      Height          =   200
      Left            =   1866
      TabIndex        =   5
      Top             =   1320
      Width           =   1200
   End
   Begin VB.OptionButton optMnoz 
      Caption         =   "Mnożenie"
      Height          =   200
      Left            =   1866
      TabIndex        =   4
      Top             =   1080
      Width           =   1200
   End
   Begin VB.OptionButton optOdejmuj 
      Caption         =   "Odejmowanie"
      Height          =   200
      Left            =   1866
      TabIndex        =   3
      Top             =   840
      Width           =   1440
   End
   Begin VB.OptionButton optDodaj 
      Caption         =   "Dodawanie"
      Height          =   200
      Left            =   1866
      TabIndex        =   2
      Top             =   600
      Value           =   -1  'True
      Width           =   1440
   End
   Begin VB.TextBox txtLiczba2 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   238
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   468
      Left            =   3480
      MultiLine       =   -1  'True
      TabIndex        =   1
      Text            =   "Matematyka.frx":0000
      Top             =   720
      Width           =   1100
   End
   Begin VB.TextBox txtLiczba1 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   238
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   468
      Left            =   656
      MultiLine       =   -1  'True
      TabIndex        =   0
      Text            =   "Matematyka.frx":0002
      Top             =   720
      Width           =   1100
   End
   Begin VB.Label lblWynik 
      AutoSize        =   -1  'True
      Caption         =   "Wynik:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   238
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   348
      Left            =   900
      TabIndex        =   8
      Top             =   2520
      Width           =   1356
   End
   Begin VB.Label lblWyswietl 
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   238
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   2580
      TabIndex        =   7
      Top             =   2520
      Width           =   1452
   End
End
Attribute VB_Name = "frmLiczenie"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdStart_Click()
    If optDodaj.Value = True Then
        lblWyswietl.Caption = Val(txtLiczba1.Text) + Val(txtLiczba2.Text)
    ElseIf optOdejmuj.Value = True Then
        lblWyswietl.Caption = Val(txtLiczba1.Text) - Val(txtLiczba2.Text)
    ElseIf optMnoz.Value = True Then
        lblWyswietl.Caption = Val(txtLiczba1.Text) * Val(txtLiczba2.Text)
    ElseIf optDziel.Value = True Then
        Dim Wynik As Single
        If txtLiczba2.Text = "0" Then
            MsgBox "Dzielenie przez 0 jest niemożliwe!"
            Exit Sub
        End If
        Wynik = Val(txtLiczba1.Text) / Val(txtLiczba2.Text)
        lblWyswietl.Caption = Format(Wynik, "0.00")
    Else
        MsgBox "Musisz wybrać działanie!"
    End If
End Sub

