Jump to content

How You Play Text in a About Tab?


Recommended Posts

hello!

for example this is my Program which have a About Tab.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 387, 227, 200, 152)
$Tab1 = GUICtrlCreateTab(8, 8, 369, 209)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Tools")
$TabSheet2 = GUICtrlCreateTabItem("About")
GUICtrlSetState(-1,$GUI_SHOW)
$Label1 = GUICtrlCreateLabel("Program Name: XXXX", 56, 48, 108, 17)
$Label2 = GUICtrlCreateLabel("Version: X>X>X>X", 56, 72, 91, 17)
$Label3 = GUICtrlCreateLabel("Website: www.MyWebSite.Com", 56, 96, 155, 17)
$Label4 = GUICtrlCreateLabel("Contact: MyMail@Test.com", 56, 120, 135, 17)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

now how can i play the text in my about Tab with a cool sound of *.WAV or *.MP3?

i think it is called marquee but i don't know how it works.

from

Left > Right

Right > Left

Up > Down

Up < Down

etc

i searched the forum and there were some examples but i could not understand them all.

Link to comment
Share on other sites

If you use a label just move its position and when it moves out of the gui simply reset its position outside the gui on the other side by the label length.

Link to comment
Share on other sites

It would probably be better to use a function than to move the label . Here's an example from the helpfile.

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $right, $label, $button, $msg
    
    GUICreate("My GUI position") ; will create a dialog box that when displayed is centered

    $right = 0
    $label = GUICtrlCreateLabel("my moving label", 10, 20)
    
    $button = GUICtrlCreateButton("Click to close", 50, 50)
    GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

    GUISetState()

    While 1
        $msg = GUIGetMsg()

        If $msg = $button Or $msg = $GUI_EVENT_CLOSE Then Exit
        If $right = 0 Then
            $right = 1
            GUICtrlSetPos($label, 20, 20)
        Else
            $right = 0
            GUICtrlSetPos($label, 10, 20)
        EndIf
        Sleep(100)
    WEnd
EndFunc  ;==>Example

That moves the label,just edit the code a bit to scroll it. As for playing the sound use either SoundPlay() or _SoundPlay().

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...