elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: 1 2 3 4 [5] 6 7 8 9
41  Programación / Programación Visual Basic / Re: restas horas en: 8 Diciembre 2006, 23:28 pm
Lo que dice Celaya es correcto, pero si lo que quieres hacer no es muy complicado puedes usar la funcion TimeValue.

Crea tres campos de texto y lo pruebas.

Código:
Text3.Text = Format((TimeValue(Text2.Text) - TimeValue(Text1.Text)), "hh:mm:ss")
42  Programación / Programación Visual Basic / Re: Duda con For, Next. en: 8 Diciembre 2006, 23:19 pm
 :P

Código:
For x = 1 To 10
   Label1.Caption = Label1.Caption & (Text1.Text & " x " & x & " = " & Val(Text1.Text) * x) & vbCr
Next
43  Programación / Programación Visual Basic / Re: Igual que Office en: 2 Diciembre 2006, 10:08 am
Una manera simple que se me ocurre (si hay pocos campos) es:

Código:
Private Sub Form_Load()
   Text1.MaxLength = 5
   Text2.MaxLength = 5
   Text3.MaxLength = 5
   Text4.MaxLength = 5
   Text5.MaxLength = 5
End Sub

Private Sub Text1_Change()
   If Len(Text1) = 5 Then Text2.SetFocus
End Sub

Private Sub Text2_Change()
   If Len(Text2) = 5 Then Text3.SetFocus
End Sub

Private Sub Text3_Change()
   If Len(Text3) = 5 Then Text4.SetFocus
End Sub

Private Sub Text4_Change()
   If Len(Text4) = 5 Then Text5.SetFocus
End Sub

Si tienes muchos campos crea una matriz de controles.

Código:
Private Sub Form_Load()
   Txt(1).MaxLength = 5
   Txt(2).MaxLength = 5
   Txt(3).MaxLength = 5
   Txt(4).MaxLength = 5
   Txt(5).MaxLength = 5
End Sub

Private Sub Txt_Change(Index As Integer)
If Len(Txt(5).Text) = 5 Then
   'Opción de salida cuando llegue al ultimo textbox
Else
   If Len(Txt(Index)) = 5 Then Txt(Index + 1).SetFocus
End If
End Sub

OJO las matrices de controles empiezan en cero pero yo no lo uso.
44  Programación / Programación Visual Basic / Re: Bloquear el teclado desde Visual Basic en: 2 Diciembre 2006, 09:47 am
Bloquear teclado:

Código:
'-----Modulo-----
Public Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long

'-----Programa-----
'Añadir un timer en el formulario
'Durante 10 segundos el teclado y mouse quedaran bloqueados

Private Sub Form_Load()
    Timer1.interval = 1000
    BlockInput True
End Sub

Private Sub Timer1_Timer()
    Static contador As Integer
    contador = contador + 1
    If contador = 10 Then BlockInput False: MsgBox "timer"
End Sub

Este code lo puso un compañero del foro.

Un saludo.
45  Programación / Programación Visual Basic / Re: crear tabla estilo Excel con VB en: 22 Noviembre 2006, 09:52 am
Mira en agregar componentes Microsoft Office XP Web Componets.

Si no te sirve puedes usar FlexGrid.




Un saludo.
46  Programación / Programación Visual Basic / Re: Dos dudas. TextBox en: 8 Noviembre 2006, 23:58 pm
ninguno de los filtros es bueno.... porque si pulsa control+v puede pegar varias cosas y con eso solamente detectas la v xD

el filtro debes aplicarlo sobre todo el valor del txt

sería mismamente lo que warghost dijo (en un while no en for) añadiendole otro while que recorra toda la cadena del text1.text y el evento seria el text1_change

menuo lio de explicación que he dao, nose si se entendera

Tienes razón Hans el Topo, pense que era algo mas simple.  :P
47  Programación / Programación Visual Basic / Re: Dos dudas. TextBox en: 8 Noviembre 2006, 13:52 pm
Otra manera:
Código:
Private Sub Text1_KeyPress(KeyAscii As Integer)

Select Case KeyAscii
   Case 65 To 90                  'Caracteres May
   Case 97 To 122                'Casracteres Mim
   Case 241                         'Letra ñ
   Case 209                         'Letra Ñ
   Case Else
      KeyAscii = 0 
End Select

End Sub
48  Programación / Programación Visual Basic / Re: duda con referencia a dll y a un ocx en: 8 Noviembre 2006, 11:01 am
Copia las librerias en:

Si es Windows 98 c\windows\system\
Si es Windows XP: c\windows\system32\

y desde la consola MSdos:
regsvr32 NombreLibreria.dll
49  Programación / Programación Visual Basic / Re: listbox y progressbar en: 5 Noviembre 2006, 12:59 pm
 :-X
50  Programación / Programación Visual Basic / Re: Visual Basic en LInux en: 11 Septiembre 2006, 03:07 am
Gracias BenRu. ;)
Páginas: 1 2 3 4 [5] 6 7 8 9
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines