Basic - Creacion de ocx

 
Vista:

Creacion de ocx

Publicado por Orlando (1 intervención) el 11/07/2001 16:01:51
Buenas primeramente los quiero felicitar por esta exelente pagina para programadores y deceandole que sigan los exitos.
Y en segundo lugar les queria pedir a ver si me podian ayudar en la creacion de ocx en visual basic, yo tengo bastante OCX de internet pero quiero crear los mios.

Esperando su pronta respuesta.
Se despide Orlando
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Creacion de ocx

Publicado por flyguille (15 intervenciones) el 23/07/2001 02:49:40
yo también tengo el mismo problema que vos, tengo instalado el VB5 y el VB6, en la help del VB5 nada decía, pero en el VB6 en la info dice claramente, que para crear un ocx, se debe programar en "C" , como tengo el paquete completo que incluye el Visual C++, y conociendo un poco de C , solo un poco, he intentado realizarlo pero te cuento que es re-re-re complicado, porque el ocx, debe trabajar con todos los eventos y propiedades y métodos, asi como metodos que normalmente el progamador no usa, como "Register" "Unregister" que son para cuando se instala /desinstala el ocx, ya que si o sí debe figurar en el registro del windows, aparte de todo eso, el ocx debe poder trabajar con todas las instancias en ejecución ya que el objeto puede estár varias veces en un mismo form, o en forms diferentes, o en aplicaciones diferente....
y en eso de hacer ocx , estoy en la mitad del camino, ya me lei la midad del manual de C.
jejejejejeje
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ejemplo de ocx

Publicado por sinmoneys (3 intervenciones) el 16/08/2001 12:30:25
esta la baje de http://welkome.to/karpoff (para poner una ocx de vb5 en una web debes registrarla en el servidor, y te digo... mejor la haces en C++)
clickas el icono Control Active X (en vez de Exe estandar) y comienzas... a hacer la tuya propia.

Dim mTipo As Integer
Enum Tipo_Text
Normal = 0
Númerico = 1
Mayúscula = 2
Minúscula = 3
Letras = 4
End Enum

Public Event Changed()
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Public Event Keypress(KeyAscii As Integer)
Public Event KeyDown(KeyCode As Integer, Shift As Integer)
Public Event KeyUP(KeyCode As Integer, Shift As Integer)
Public Event Click()
Public Event DbClick()
Public Function SaveFile(FilePath As String)
Open FilePath For Output As #2
Print #2, Text1.TEXT
Close #2
End Function
Public Function OpenFile(FilePath As String)
Open FilePath For Binary As #1

Text1.TEXT = Input(LOF(1), 1)

Close #1
End Function
Public Function Minuscula(Tecla As Integer) As Integer


Minuscula = Asc(LCase(Chr(Tecla)))


End Function
Public Function Mayusculas(Tecla As Integer) As Integer


Mayusculas = Asc(UCase(Chr(Tecla)))


End Function
Public Function SLetras(Tecla As Integer) As Integer

Dim strVa
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

continuacion

Publicado por sinmoneys (3 intervenciones) el 16/08/2001 12:31:59

Dim strValido As String

strValido = "qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM,.*-}¿'!%&/()=?¡]¨*[Ñ;:_><+[]{}"

If Tecla > 26 Then
If InStr(strValido, Chr(Tecla)) = 0 Then
Tecla = 0
End If
End If

SLetras = Tecla

End Function

Public Function Numeros(Tecla As Integer) As Integer

Dim strValido As String

strValido = "0123456789"

If Tecla > 26 Then
If InStr(strValido, Chr(Tecla)) = 0 Then
Tecla = 0
End If
End If

Numeros = Tecla

End Function


Public Property Get Font() As Font
Set Font = Text1.Font
End Property

Public Property Get ForeColor() As OLE_COLOR
ForeColor = Text1.ForeColor
End Property

Public Property Get BackColor() As OLE_COLOR
BackColor = Text1.BackColor
End Property

Public Property Get TEXT() As String
TEXT = Text1.TEXT
End Property

Public Property Let Tipo(ByVal NuevoValor As Tipo_Text)

mTipo = NuevoValor
PropertyChanged "Tipo"

End Property

Public Property Get Enabled() As Boolean
Enabled = Text1.Enabled
End Property
Public Property Get ToolTipText() As String
ToolTipText = Text1.ToolTipText
End Property
Public Property Get Locked() As Boolean
Locked = Text1.Locked
End Property

Public Property Get SelStart() As Int
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:continuacion 2

Publicado por sinmoneys (3 intervenciones) el 16/08/2001 12:34:02
Public Property Get SelStart() As Integer
SelStart = Text1.SelStart
End Property
Public Property Get MaxLenght() As Integer
MaxLenght = Text1.MaxLength
End Property

Public Property Get PasswordChar() As String
PasswordChar = Text1.PasswordChar
End Property

Public Property Set Font(ByVal NuevoValor As Font)
Set Text1.Font = NuevoValor
PropertyChanged "Font"
End Property

Public Property Let ForeColor(ByVal NuevoValor As OLE_COLOR)
Text1.ForeColor() = NuevoValor
PropertyChanged "ForeColor"
End Property

Public Property Let BackColor(ByVal NuevoValor As OLE_COLOR)
Text1.BackColor() = NuevoValor
PropertyChanged "BackColor"
End Property
Public Property Let SelText(ByVal NuevoValor As String)
Text1.SelText = NuevoValor
PropertyChanged "SelText"
End Property
Public Property Let TEXT(ByVal NuevoValor As String)
Text1.TEXT = NuevoValor
PropertyChanged "Text"
End Property

Public Property Let Enabled(ByVal NuevoValor As Boolean)

Text1.Enabled = NuevoValor
PropertyChanged "Enabled"

End Property

Public Property Let Locked(ByVal NuevoValor As Boolean)

Text1.Locked = NuevoValor
PropertyChanged "Locked"

End Property
Public Function FindText(PalabraClave, Optional ByVal PosIni As Integer)
On Error GoTo error:
'La variable PalabraClave toma el valor de txtBuscar

'Verificar si PalabraClave no esta vacia
If Len(PalabraClave) Then
'Verificar si
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ejemplo de ocx

Publicado por alex (1 intervención) el 01/12/2007 17:25:47
teoria del ocx sus controles y ejemplos de cada uno
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar