home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / averye1a / textboxe.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-22  |  4.8 KB  |  134 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Texbox Control For Beginners"
  4.    ClientHeight    =   4335
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4470
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   4335
  10.    ScaleWidth      =   4470
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Command6 
  13.       Caption         =   "Click and then put mouse over the textbox"
  14.       Height          =   255
  15.       Left            =   600
  16.       TabIndex        =   6
  17.       Top             =   3720
  18.       Width           =   3255
  19.    End
  20.    Begin VB.CommandButton Command5 
  21.       Caption         =   "Click to show an InputBox"
  22.       Height          =   255
  23.       Left            =   1080
  24.       TabIndex        =   5
  25.       Top             =   3360
  26.       Width           =   2175
  27.    End
  28.    Begin VB.CommandButton Command4 
  29.       Caption         =   "Click this to show a message box."
  30.       Height          =   375
  31.       Left            =   840
  32.       TabIndex        =   4
  33.       Top             =   2880
  34.       Width           =   2655
  35.    End
  36.    Begin VB.CommandButton Command3 
  37.       Caption         =   "Click this to make text in textbox uppercase"
  38.       Height          =   375
  39.       Left            =   480
  40.       TabIndex        =   3
  41.       Top             =   2400
  42.       Width           =   3375
  43.    End
  44.    Begin VB.CommandButton Command2 
  45.       Caption         =   "Click this to change the background color"
  46.       Height          =   375
  47.       Left            =   600
  48.       TabIndex        =   2
  49.       Top             =   1920
  50.       Width           =   3135
  51.    End
  52.    Begin VB.CommandButton Command1 
  53.       Caption         =   "Click this button to make text colored"
  54.       Height          =   375
  55.       Left            =   720
  56.       TabIndex        =   1
  57.       Top             =   1440
  58.       Width           =   2775
  59.    End
  60.    Begin VB.TextBox Text1 
  61.       Height          =   615
  62.       Left            =   840
  63.       MultiLine       =   -1  'True
  64.       TabIndex        =   0
  65.       Text            =   "TextBoxes.frx":0000
  66.       Top             =   480
  67.       Width           =   2775
  68.    End
  69.    Begin VB.Shape Shape1 
  70.       Height          =   2895
  71.       Left            =   360
  72.       Top             =   1320
  73.       Width           =   3615
  74.    End
  75. Attribute VB_Name = "Form1"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. ' Made by Mike
  81. ' purpose: to help beginers who are feeling lost and need
  82. ' to have help getting started
  83. ' if you have any questions , comments
  84. ' send email to mikesullins@diplomats.com
  85. 'thanks
  86. Private Sub Command1_Click()
  87. ' the forecolor part means what color the text will
  88. 'be , there are many other colors you can use.
  89. ' Try puting these instead of vbred
  90. 'vbBlue
  91. 'vbWhite
  92. 'vbgreen
  93. ' and use RGB(10,80,120) try using other numbers in this too
  94. Text1.ForeColor = vbRed ' try those on top and experiment
  95. End Sub
  96. Private Sub Command2_Click()
  97. Text1.BackColor = vbRed
  98. ' the backcolor part means the color of
  99. ' the back of the text box. you can use any of the
  100. ' constants to change it
  101. ' constants in vb for colors are
  102. ' vbblack, vbred, vbblue, vbgreen, vbblack, and RGB(10,60,80)
  103. ' RGB stands for Red Green Blue, and in above example
  104. ' 10 is the amount of Red, 60 is the amount of Green
  105. ' and 80 is the amount of Blue
  106. End Sub
  107. Private Sub Command3_Click()
  108. Text1.Text = UCase(Text1.Text)
  109. ' all this does is makes the text in the textbox
  110. ' become uppercase letters by using the UCase() function
  111. ' try using Text1.Text = Lcase(Text1.Text) and see what will
  112. ' happen.
  113. End Sub
  114. Private Sub Command4_Click()
  115. Dim s As String ' here we make a varible named s that will hold a string ( a string is only a fancy way of saying text, or simpler terms , letters)
  116. s = MsgBox("This is a message box.", vbOKOnly, "Hello")
  117. ' we say s is a message box using the MsgBox() function
  118. ' the "This is a message box" is what will be displayed in the message
  119. ' the vbOkOnly just says that it will have one button on the message, an Ok button
  120. ' the last part, "Hello" is what the title bar will say on the message box
  121. End Sub
  122. Private Sub Command5_Click()
  123. Dim s As String ' make a varible called s that holds text
  124. s = InputBox("This is an input box, please enter your name", "This is the title") ' the first part is whats in it, and the second is the title
  125. MsgBox "Hello " & s ' this combines the msgbox() function in here to display the name entered in to the inputbox
  126. End Sub
  127. Private Sub Command6_Click()
  128. Text1.ToolTipText = "Hello this is a tooltiptext"
  129. ' tooltiptext's are the bubbles that popup when the mouse rests
  130. ' on something. in other words just put the mouse
  131. ' pointer over the texbox after you click this button and wait till you see
  132. ' you cant miss it
  133. End Sub
  134.