1. Como se programa un label?
Usamos el comando label que nos sirve para cambiar, crear o
eliminar.
' Visual Basic 6.0
Private Sub MakeTransparent()
Label1.BackStyle = vbTransparent
End Sub
Como se programa un Option button?
2. Se programa como parte de un grupo de opciones conotros botones
de opción,presenta varias opciones en la que el usuario solo puede
elegir una
' Visual Basic 6.0
If Option1.Value = True Then
Option2.Value = True
Else
Option1.Value = True
End If
3. Como se programa un textbox?
Un TextBox es un control que principalmente utilizamos para que el
usuario introduzca datos, pero también puede mostrar una respuesta
predeterminadao incluso servir para mostrar en vez de para pedir
datos.
' Visual Basic 6.0
Private Sub Form_Load ()
Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music."
End Sub
Private Sub Form_Click ()
Dim Search, Where
' Get search string from user.
Search = InputBox("Enter text to be found:")
' Find string in text.
Where = InStr(Text1.Text, Search)
If Where Then
Text1.SetFocus
Text1.SelStart = Where - 1
Text1.SelLength = Len(Search)
Else
MsgBox "String not found."
End If
End Sub
4. Como se programa un Command
button?
nos permite ejecutar alguna rutina, función o procedimiento,
generalmente en el evento click del mismo,para realizar de esta
manera alguna tarea dentro del programa.
' Visual Basic 6.0
' Set the first button to respond to the Enter key.
Command1.Default = True
' Set the second button to respond to the Esc key.
Command2.Cancel = True
5. Como se programa un Picture box?
Esta propiedad es la que indica el gráfico que estará cargado. Para
cargar un gráfico en visual basic desde el disco.
' Visual Basic 6.0
Picture1.Picture = LoadPicture(App.Path & "somepicture.jpg")
6. Como se programa un Frame?
La herramienta Frame sirve para agrupar otros objetos,se inserta el
Frame y luego se pone los objetos dentro. Es muy útil para agrupar
objetos o hacer barras de herramientas. También se le conoce como
marco o panel, observar que incluye un pestaña, donde se describe en
forma lógica todos los controles que agrupa.
1. Option Explicit
2.
3. Private Sub Command1_Click()
4. ' -- Cambiar el caption
5. Frame1.Caption = "Texto del Frame"
6. End Sub