A) Program Design :
(B) Property(Controls Used) :
- 2 Labels Number & Square root
- 2 Text Boxes whose Index is 0&1 respectively...........Text Property is Zero for both..............and the Locked Property is True for the second Text Box (that is the text box for getting the result)
- One Command Button with Caption Find Square root.
(C) Attaching Code to the Object :
Private Sub Command1_Click() Text2.Text = Sqr(Val(Text1.Text)) End Sub |
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) If Index = 0 And (KeyAscii < 48 Or KeyAscii > 57) Then SendKeys (Char(8)) End If End Sub |
Possible Error : Sub or Function Not Defined
====================================================================
No comments:
Post a Comment