VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 2130 ClientLeft = 60 ClientTop = 405 ClientWidth = 4395 LinkTopic = "Form1" ScaleHeight = 2130 ScaleWidth = 4395 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command3 Caption = "Esci" Height = 1095 Left = 3720 TabIndex = 7 Top = 480 Width = 615 End Begin VB.CommandButton Command2 Caption = "Cancella" Enabled = 0 'False Height = 1095 Left = 2520 TabIndex = 6 Top = 480 Width = 1095 End Begin VB.CommandButton Command1 Caption = "x^y" Height = 1095 Left = 1440 TabIndex = 5 Top = 480 Width = 975 End Begin VB.TextBox Text3 Height = 375 Left = 120 TabIndex = 2 Top = 1680 Width = 4215 End Begin VB.TextBox Text2 Height = 375 Left = 120 TabIndex = 1 Top = 1200 Width = 1215 End Begin VB.TextBox Text1 Height = 375 Left = 120 TabIndex = 0 Top = 480 Width = 1215 End Begin VB.Label Label3 AutoSize = -1 'True Caption = "Calcolo di potenza" BeginProperty Font Name = "Arioso" Size = 20.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H8000000D& Height = 465 Left = 1440 TabIndex = 8 Top = 0 Width = 2895 End Begin VB.Label Label2 Caption = "Esponente" Height = 495 Left = 120 TabIndex = 4 Top = 960 Width = 1215 End Begin VB.Label Label1 Caption = "Base" Height = 495 Left = 120 TabIndex = 3 Top = 240 Width = 1215 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim b, e As Integer Dim p As Single Private Sub Command1_Click() b = Val(Text1.Text) e = Val(Text2.Text) p = 1 If e >= 0 Then For i = 1 To e p = p * b Next i Text3.Text = "la potenza di " & CStr(b) & " elevato a " & CStr(e) & " è " & CStr(p) Command2.Enabled = True Else e = -e For i = 1 To e p = p * b Next i p = 1 / p Text3.Text = "la potenza di " & CStr(b) & " elevato a " & CStr(e) & " è " & CStr(p) Command2.Enabled = True End If End Sub Private Sub Command2_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub Private Sub Command3_Click() End End Sub Private Sub Text1_Change() Text2.Text = "" Text3.Text = "" End Sub