Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it L'avatar di icosimo
    Registrato dal
    Sep 2001
    Messaggi
    259

    VS2008 - Testo scorrevole

    Ciao "FORUM",

    VS2008 - Visual Basic - Testo scorrevole



    Vorrei poter far scorrere in una "Label" del testo.
    Nel FORUM ho trovato il codice per VB6 che riporto:

    ********************************
    Dim sTesto As String, btStart As Byte
    Private Sub Form_Load()
    sTesto = "Prova testo scorrevole in una Lbl"
    btStart = 1
    End Sub
    Private Sub Timer1_Timer()
    Label1.Caption = Right(sTesto, Len(sTesto) - btStart) + Left(sTesto, btStart)
    btStart = btStart + 1
    If btStart > Len(sTesto) Then btStart = 1
    End Sub
    *********************************

    In VB6 , dopo aver inserito il controllo "Timer", il codice funziona, il testo scorre .
    Ho fatto la stessa cosa in VS2008 , anche qui il codice funziona, non segnala alcun errore, ma il testo non scorre.
    Qualcuno sa come posso risolvere?

    In attesa, grazie.
    Windows 7 Home Premium SP1 64 bit - AMD Athlon(tm) 64x2 Dual Core Processor 6000+ 3.00 GHz - 4 GB RAM - NVIDIA GeForce 8400 GS

  2. #2
    Utente di HTML.it L'avatar di Stoicenko
    Registrato dal
    Feb 2004
    Messaggi
    2,254
    forse perchè non fai timer.start()

  3. #3
    Utente di HTML.it L'avatar di icosimo
    Registrato dal
    Sep 2001
    Messaggi
    259
    Originariamente inviato da Stoicenko
    forse perchè non fai timer.start()
    Sì, grazie Stoicenko per aver risposto.

    Credo di averle provate tutte, ma non so come utilizzare il tuo suggerimento. Qualsiasi cosa faccia non cambia nulla, il testo resta immobile.

    Se puoi dirmi ancora qualcosa !!

    Ciao.
    Windows 7 Home Premium SP1 64 bit - AMD Athlon(tm) 64x2 Dual Core Processor 6000+ 3.00 GHz - 4 GB RAM - NVIDIA GeForce 8400 GS

  4. #4
    Utente di HTML.it L'avatar di Boolean
    Registrato dal
    Oct 2005
    Messaggi
    758
    Prova questo

    codice:
    Public Class Form1
    
        Dim WithEvents tim As New Timer
        Dim TheLabel As New Label
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            TheLabel.Location = New Point(20, 20)
            TheLabel.Parent = Me
            TheLabel.AutoSize = True
            TheLabel.Text = "Questo è un testo di prova     "
            tim.Interval = 100
            tim.Enabled = True
        End Sub
    
        Private Sub tim_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tim.Tick
            Dim t As String = TheLabel.Text
            t = t.Substring(1) & t.Chars(0)
            TheLabel.Text = t
        End Sub
    End Class
    TheTruster

  5. #5
    Utente di HTML.it L'avatar di icosimo
    Registrato dal
    Sep 2001
    Messaggi
    259
    Grazie Boolean.

    Funziona benissimo.

    Ciao.
    Windows 7 Home Premium SP1 64 bit - AMD Athlon(tm) 64x2 Dual Core Processor 6000+ 3.00 GHz - 4 GB RAM - NVIDIA GeForce 8400 GS

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.