canal visual basic .net

Recursos Visual Basic.NET, VB.NET, Manuales de programación, Tutoriales, Foros de programación, Comunidad de programadores

Usuarios activos:  56

Foros de programación, recursos, tutoriales, sistemas operativos...

Bienvenido a la zona de foros. Participa en alguno de nuestros foros: Foros de visual basic, foros de visual basic.net foros de Crystal reports, programas gratis, foros de C++ - C# , foros de Java, foros de PHP, foros de ASP.net. Seguro que hay un foro que te servirá de gran utilidad y si no lo encuentras avísanos y crearemos uno nuevo.
Resultados 1 al 4 de 4
  1. #1
    Post-Newbie está desconectado Member Iniciad@
    Fecha de ingreso
    26 ene, 06
    Mensajes
    66

    Predeterminado


    Todabía no la tengo termianda pero dejo lo que ya tengo. Hasta el momento solo muestra ventanas...
    Importante: Para el funcionamiento del código es necesario el truevision 3d, puede ser descargado de: TV3D

    En un Form1:
    Código:
    Option Explicit
    Private   TV&amp ;nbs p; As TVEngine
    Private   Scr&am p;nb sp; As TVScreen2DImmediate
    Private   ScrText&nbsp ; ; As TVScreen2DText
    Private WithEvents Inp As TVInputEngine
    Private   Running&nbsp ; ; As Boolean
    Private   tst&am p;nb sp; As siGUI
    
    Private Sub Form_Load()
    
     Set TV = New TVEngine
     Set Scr = New TVScreen2DImmediate
     Set ScrText = New TVScreen2DText
     Set Inp = New TVInputEngine
     Set tst = New siGUI
     Me.Show
     TV.Init3DWindowedMode Me.hWnd
     TV.DisplayFPS = True
     Inp.EnableEvents True
     With tst
     Set .Scr = Scr
     Set .ScrText = ScrText
     Set .Inp = Inp
     End With
     Running = True
     Do
     DoEvents
     TV.Clear
     Scr.ACTION_Begin2D
     tst.RenderizarTodo
     Scr.ACTION_End2D
     If Inp.IsKeyPressed(TV_KEY_S) Then
       Randomize
       tst.AddWindow Rnd * 200, Rnd * 200, 100, 100, Rnd * 100, RGBA(Rnd, Rnd, Rnd, 0.99), RGBA(Rnd, Rnd, Rnd, 1)
     End If
     TV.RenderToScreen
     Loop While Running
     Set TV = Nothing
     Set Scr = Nothing
     Set ScrText = Nothing
     Set Inp = Nothing
     Set tst = Nothing
     Unload Me
    
    End Sub
    
    Private Sub Form_QueryUnload(Cancel As Integer, _
         UnloadMode As Integer)
    
     If Running Then
     Running = False
     Cancel = 1
     End If
    
    End Sub
    
    Private Sub Form_Resize()
    
     TV.ResizeDevice
     Inp.EnableEvents True
     Set tst.Inp = Inp
    
    End Sub
    En un módulo de clase "siGUI"
    Código:
    Option Explicit
    'local variable(s) to hold property value(s)
    Private   mvarWindows& amp; nbsp; As Collection 'local copy
    Private mvar  Scr&am p;nb sp; As TVScreen2DImmediate 'local copy
    Private mvar  ScrText&nbsp ; ; As TVScreen2DText 'local copy
    Private WithEvents mvarInp As TVInputEngine 'local copy
    Private Dragging   As Boolean 'Arrastrando?
    Private DrgWin   As Integer 'a quién?
    Private Order()   As Integer 'mantiene el orden de las ventanas
    
    Public Function AddWindow(ByVal x As Long, _
         ByVal Y As Long, _
         ByVal Alto As Long, _
         ByVal Ancho As Long, _
         ByVal strCaption As String, _
         Optional ByVal lngBackColor As Long, _
         Optional ByVal BorderColor As Long, _
         Optional ByVal Nombre As String) As Object
    
    Dim newObj As siWindow
    
     Set newObj = New siWindow
     With newObj 'asigno todas las propiedades
     .PosX = x
     .PosY = Y
     .Alto = Alto
     .Ancho = Ancho
     .Caption = strCaption
     .BackColor = lngBackColor
     .BorderColor = BorderColor
     Set .Scr = mvarScr
     Set .ScrText = mvarScrText
     End With
     If Len(Nombre) = 0 Then
     mvarWindows.Add newObj
     Else
     mvarWindows.Add newObj, Nombre
     End If
     Set newObj = Nothing
     ReDim Preserve Order(1 To Windows.Count)
     Order(Windows.Count) = Windows.Count
    
    End Function
    
    Private Sub Class_Initialize()
    
     Set mvarWindows = New Collection
    
    End Sub
    
    Private Sub Class_Terminate()
    
     Set mvarWindows = Nothing
    
    End Sub
    
    Public Property Get Inp() As TVInputEngine
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Inp
    
     Set Inp = mvarInp
    
    End Property
    
    Public Property Set Inp(ByVal vData As TVInputEngine)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.Inp = Form1
    
     Set mvarInp = vData
    
    End Property
    
    Private Sub mvarInp_MouseChanged(ByVal x As Long, _
           ByVal Y As Long, _
           ByVal Z As Long, _
           ByVal Button1 As Boolean, _
           ByVal Button2 As Boolean, _
           ByVal Button3 As Boolean, _
           ByVal Button4 As Boolean)
    
    Dim i As Integer
    Dim ax As Long
    Dim ay As Long
    
     '<:-) :UPDATED: Multiple Dim line separated
     '<:-) :PREVIOUS CODE : Dim ax As Long, ay As Long
    Dim j As Integer
    Dim oldOrder() As Integer
     If Windows.Count > 0 Then 'si hay ventanas
     Inp.GetAbsMouseState ax, ay 'obtengo las direcciones absolutas del mouse
     For i = 1 To Windows.Count 'recorro ventanas
       If Not Dragging Then 'si no se está arrastrando
       With Windows(Order(i))
       If ax > .PosX And ax < .PosX + .Ancho And ay > .PosY And ay < .PosY + 15 And Button1 Then 'si le hago click
         .PosX = ax - .Ancho / 2
         .PosY = ay - 15 / 2
         Dragging = True
         DrgWin = Order(i)
         If Not (i = 1) Then
         oldOrder = Order
         Order(1) = Order(i)
         For j = 2 To UBound(Order)
         Order(j) = oldOrder(j - 1)
         If oldOrder(j) = Order(1) Then
           Exit For
         End If '<:-) Structure Expanded.
         Next j
         End If
       End If
       End With
       Else
       Windows(DrgWin).PosX = ax - Windows(DrgWin).Ancho / 2
       Windows(DrgWin).PosY = ay - 15 / 2
       Exit For
       End If
     Next i
     If Dragging And Not Button1 Then
       Windows(DrgWin).Focused = False
       Dragging = False
     End If
     End If
    
    End Sub
    
    Public Sub RenderizarTodo()
    
    Dim i As Integer
    
     If Windows.Count > 0 Then
     'Dim focwin As Integer
     For i = Windows.Count To 1 Step -1
       'If Not Windows(Order(i)).Focused Then
       Windows(Order(i)).Renderizar
       'Else: focwin = i
       'End If
     Next i
     'If focwin > 0 Then Windows(focwin).Renderizar
     End If
    
    End Sub
    
    Public Property Get Scr() As TVScreen2DImmediate
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Scr
    
     Set Scr = mvarScr
    
    End Property
    
    Public Property Set Scr(ByVal vData As TVScreen2DImmediate)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.Scr = Form1
    
     Set mvarScr = vData
    
    End Property
    
    Public Property Get ScrText() As TVScreen2DText
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.ScrText
    
     Set ScrText = mvarScrText
    
    End Property
    
    Public Property Set ScrText(ByVal vData As TVScreen2DText)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.ScrText = Form1
    
     Set mvarScrText = vData
    
    End Property
    
    Public Property Get Windows() As Collection
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Windows
    
     Set Windows = mvarWindows
    
    End Property
    
    Public Property Set Windows(ByVal vData As Collection)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.Windows = Form1
    
     Set mvarWindows = vData
    
    End Property
    Y en otro m de clase "siWindow"
    Código:
    Option Explicit
    'local variable(s) to hold property value(s)
    Private   mvarPosX&amp ;nbs p; As Long   'local copy
    Private   mvarPosY&amp ;nbs p; As Long   'local copy
    Private mvarAncho As Long   'local copy
    Private   mvarAlto&amp ;nbs p; As Long   'local copy
    Private mvarFocused As   Boolean&nbsp ; ; 'local copy
    Private mvarBackColor As Long   'local copy
    Private mvarBorderColor As Long   'local copy
    'local variable(s) to hold property value(s)
    Private mvarCaption As String   'local copy
    'local variable(s) to hold property value(s)
    Private   mvarScr&nbsp ; ; As TVScreen2DImmediate 'local copy
    Private mvarScrText As TVScreen2DText 'local copy
    
    Public Property Get Alto() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Alto
    
     Alto = mvarAlto
    
    End Property
    
    Public Property Let Alto(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.Alto = 5
    
     mvarAlto = vData
    
    End Property
    
    Public Property Get Ancho() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Ancho
    
     Ancho = mvarAncho
    
    End Property
    
    Public Property Let Ancho(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.Ancho = 5
    
     mvarAncho = vData
    
    End Property
    
    Public Property Get BackColor() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.BackColor
    
     BackColor = mvarBackColor
    
    End Property
    
    Public Property Let BackColor(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.BackColor = 5
    
     mvarBackColor = vData
    
    End Property
    
    Public Property Get BorderColor() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.BorderColor
    
     BorderColor = mvarBorderColor
    
    End Property
    
    Public Property Let BorderColor(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.BorderColor = 5
    
     mvarBorderColor = vData
    
    End Property
    
    Public Property Get Caption() As String
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Caption
    
     Caption = mvarCaption
    
    End Property
    
    Public Property Let Caption(ByVal vData As String)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.Caption = 5
    
     mvarCaption = vData
    
    End Property
    
    Public Property Get Focused() As Boolean
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Focused
    
     Focused = mvarFocused
    
    End Property
    
    Public Property Let Focused(ByVal vData As Boolean)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.Focused = 5
    
     mvarFocused = vData
    
    End Property
    
    Public Property Get PosX() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.PosX
    
     PosX = mvarPosX
    
    End Property
    
    Public Property Let PosX(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.PosX = 5
    
     mvarPosX = vData
    
    End Property
    
    Public Property Get PosY() As Long
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.PosY
    
     PosY = mvarPosY
    
    End Property
    
    Public Property Let PosY(ByVal vData As Long)
    
    'used when assigning a value to the property, on the left side of an assignment.
    'Syntax: X.PosY = 5
    
     mvarPosY = vData
    
    End Property
    
    Public Sub Renderizar()
    
     With mvarScr
     .DRAW_FilledBox mvarPosX, mvarPosY, mvarPosX + mvarAncho, mvarPosY + mvarAlto, IIf(mvarBackColor = 0, RGBA(1, 1, 1, 0.75), mvarBackColor)
     .DRAW_Box mvarPosX, mvarPosY, mvarPosX + mvarAncho, mvarPosY + mvarAlto, IIf(mvarBorderColor = 0, -1, mvarBorderColor)
     .DRAW_Box mvarPosX + 2, mvarPosY + 2, mvarPosX + mvarAncho - 2, mvarPosY + mvarAlto - 2, IIf(mvarBorderColor = 0, -1, mvarBorderColor)
     .DRAW_Line mvarPosX + 2, mvarPosY + 15, mvarPosX + mvarAncho - 2, mvarPosY + 15, IIf(mvarBorderColor = 0, -1, mvarBorderColor)
     End With 'Scr
     mvarScrText.TextureFont_DrawText mvarCaption, mvarPosX + 4, mvarPosY + 2, -1
    
    End Sub
    
    Public Property Get Scr() As TVScreen2DImmediate
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.Scr
    
     Set Scr = mvarScr
    
    End Property
    
    Public Property Set Scr(ByVal vData As TVScreen2DImmediate)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.Scr = Form1
    
     Set mvarScr = vData
    
    End Property
    
    Public Property Get ScrText() As TVScreen2DText
    
    'used when retrieving value of a property, on the right side of an assignment.
    'Syntax: Debug.Print X.ScrText
    
     Set ScrText = mvarScrText
    
    End Property
    
    Public Property Set ScrText(ByVal vData As TVScreen2DText)
    
    'used when assigning an Object to the property, on the left side of a Set statement.
    'Syntax: Set x.ScrText = Form1
    
     Set mvarScrText = vData
    
    End Property
    Saludos y espero tener más pronto...

    Edited by: Post-Newbie

    Obtenlo YA!
    Y no olvides probar el StumbleUpon

  2. #2
    JonathanQC está desconectado Junior Member Iniciad@
    Fecha de ingreso
    09 abr, 11
    Mensajes
    1

    Predeterminado -------------

    Editado por spam
    Última edición por Leandro; 15/05/2011 a las 02:42 Razón: Spam

  3. #3
    deepdns69 está desconectado Junior Member Iniciad@
    Fecha de ingreso
    23 abr, 12
    Mensajes
    1

    Predeterminado GNOCCA a ITALIA

    GNOCCA - escort accompagnatrici ragazze trans e coppie GNOCCA a ITALIA.
    Escort Incontri Tutta L Italia - GNOCCA

  4. #4
    retagfer está desconectado Junior Member Iniciad@
    Fecha de ingreso
    25 abr, 12
    Mensajes
    1

    Predeterminado retyrdown

    Je¿eli planujesz zakup komputera stacjonarnego, laptopa, drukarki lub rozbudowê komputera warto odwiedziæ strony: <A href="http://www.zakupkomputera.comze.com">http://www.zakupkomputera.comze.com</A> , <A href="http://www.zakuplaptopa.comeze.com">http://www.zakuplaptopa.comeze.com</A> , <A href="http://drukarki.comze.com">http://drukarki.comze.com</A> . Jest tam wiele ciekawych i przydatnych wiadomoœci pomog¹cych przy wyborze sprzêtu komputerowego.
    retyrdown

Temas similares

  1. extraer valores de un datagrid si checkbox es True
    Por cestradah en el foro Visual Basic .NET
    Respuestas: 2
    Último mensaje: 06/05/2009, 16:43
  2. Ayuda con True DBGrid
    Por maxee en el foro Visual Basic 6.0
    Respuestas: 0
    Último mensaje: 03/03/2009, 12:15
  3. True type Codigo de barras 39 o EAN13
    Por Axisgar en el foro Visual Basic .NET
    Respuestas: 1
    Último mensaje: 09/10/2007, 08:53
  4. checked=true
    Por cesarmtzlp en el foro Visual Basic .NET
    Respuestas: 1
    Último mensaje: 06/05/2007, 14:08
  5. como hacer para que un True Db Grid no actualize
    Por edu_jose en el foro Visual Basic 6.0
    Respuestas: 1
    Último mensaje: 03/11/2006, 09:43

Permisos de publicación

  • No puedes crear nuevos temas
  • No puedes responder temas
  • No puedes subir archivos adjuntos
  • No puedes editar tus mensajes
  •  
Visual Studio .VisualBasic.net .ADO.NET .ASP.NET .Framework .Crystal report
[Visual Basic .NET · Información legal · Condiciones de uso · Publicidad · Contacto · RSS novedades Foro · Inicio]
Un sitio web de Internelia (Ontecnia) © Copyright 2013 canalvisualbasic.net. Todos los derechos reservados