Page 1 of 2 12 LastLast
Results 1 to 40 of 61

Thread: Teleprompter

  1. #1

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37

    Teleprompter

    i am creating a teleprompter software. i want the following things

    1. scrolling text smoothly in a picturebox from bottom to top and vice versa from top to bottom.
    2. the speed of scrolling text should be adjustable to the maximum and minimum.

  2. #2
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    Here is the logic for moving text smoothly in your picturebox


    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private gmloop As Boolean
    4.  
    5. Private Sub Form_Load()
    6. Dim i As Integer
    7. Dim strStr As String
    8. Dim tmp As Long
    9. Dim UpDown As Integer
    10.  
    11. Me.ScaleMode = 3
    12. Picture1.ScaleMode = 3
    13. Me.Show
    14. Picture1.CurrentX = 10
    15. strStr = "Hello this is your Text" & vbCrLf & "Hello how are you " & vbCrLf & " "
    16. UpDown = 1
    17. While Not gmloop
    18.    
    19.     DoEvents
    20.     If GetTickCount - tmp > 50 Then
    21.         Picture1.Cls
    22.         tmp = GetTickCount
    23.         Picture1.CurrentY = i
    24.         Picture1.Print strStr
    25.         i = i + UpDown
    26.         If i < -10 Or i > Picture1.ScaleHeight Then UpDown = -UpDown
    27.     End If
    28.    
    29. Wend
    30. End
    31. End Sub
    32.  
    33. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    34.     gmloop = True
    35. End Sub
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  3. #3
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    To change the speed
    Modify the the code ...

    VB Code:
    1. If GetTickCount - tmp > 50 Then

    Change To

    VB Code:
    1. If GetTickCount - tmp > tDelay Then
    2. ' Control the value of tDelay using a Scroll bar or whatever....


    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    the text is scrolling smoothly. but i have a problem. when i press the up arrow key it should scroll up and when i press the down arrow key it should scroll down from the current scrolling line. By default the text should start scrolling from bottom to top. i would of great help if u could solve this.i require it very urgently.

  5. #5
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    Here it is..

    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private gmloop As Boolean
    4. Dim UpDown As Integer
    5.  
    6. Private Sub Form_Load()
    7. Dim i As Integer
    8. Dim strStr As String
    9. Dim tmp As Long
    10.  
    11.  
    12. Me.ScaleMode = 3
    13. Picture1.ScaleMode = 3
    14. Me.Show
    15. Picture1.CurrentX = 10
    16. strStr = "Hello this is your Text" & vbCrLf & "Hello how are you " & vbCrLf & " "
    17. i = Picture1.ScaleHeight
    18. UpDown = 1
    19. While Not gmloop
    20.    
    21.     DoEvents
    22.     If GetTickCount - tmp > 50 Then
    23.         Picture1.Cls
    24.         tmp = GetTickCount
    25.         Picture1.CurrentY = i
    26.         Picture1.Print strStr
    27.         i = i + UpDown
    28.         If i < -10 Or i > Picture1.ScaleHeight Then UpDown = -UpDown
    29.     End If
    30.    
    31. Wend
    32. End
    33. End Sub
    34.  
    35. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    36.     gmloop = True
    37. End Sub
    38.  
    39. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    40.     Select Case KeyCode
    41.         Case vbKeyUp
    42.             UpDown = -1
    43.         Case vbKeyDown
    44.             UpDown = 1
    45.     End Select
    46. End Sub
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  6. #6

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    the up and down arrow keys are working perfectly. but why is the text bouncing back if it reaches the top and bottom of the picturebox. actaually i would be loading a large text file. So the text should keep scrolling from bottom to top till it reaches the last line of the text. i should not bounce back when it reaches the border of the picturebox. even while scrolling from top to bottom it is the same. i hope u would have understood. this is for news reading purpose. the reader should keep on reading the text as it scrolls from bottom to top.

  7. #7
    Hyperactive Member The Dutch Dude's Avatar
    Join Date
    Nov 2001
    Location
    Holland. Land of the Dutch. Home for me.
    Posts
    261
    quicky glancing over the code, removing this line might do the trick:
    VB Code:
    1. If i < -10 Or i > Picture1.ScaleHeight Then UpDown = -UpDown
    Obey the dragon thing. Or not. Or possibly just a bit.

  8. #8
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Re: Teleprompter

    Hi ayesha16,

    I guess you requirements were..

    Originally posted by ayesha16
    i am creating a teleprompter software. i want the following things

    1. scrolling text smoothly in a picturebox from bottom to top and vice versa from top to bottom.
    2. the speed of scrolling text should be adjustable to the maximum and minimum.
    You have mentioned vice versa..

    Are you new to VB...?.... If not.. I guess you can change the code..

    If not let me know I will do it at my leisure...

    Please give me your exact requirements.

    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  9. #9

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    Hi,

    My exact requirements are as follows. Actually i am doing a teleprompter software for news reading purpose. This should be in the form of a text editor. I would be loading a Txt file in a picturebox.Once i press the space bar the text should scroll smoothly in the picturebox from bottom to top. this is done so that the news reader could read the scrolling text till the last line of text file. it is possible to stop the scrolling text in the middle. So in order to stop the scrolling text the space bar should be pressed. the space bar should be pressed again to continue scrolling. the up and down arrow keys should be used to either scroll text upwards or downwards from the current line which i alredy mentioned. the left and right arrow keys should be used to increase and decrese the speed. since this is a teleprompter software there would be mirror in front of the teleprompter machine. So the reader would not be able to read in the proper order in the mirror. i would be reversed. so there should be a method to reverse the scrolling text with a mirrored font as well. hope u would have understood what i want here. when i press F9 key the mirror image of the scrolling text should be visible which could be readable when it reflects on a mirror. When i press F8 key agin the original scrolling text should be seen. These are my requirements. Please help me out. Iam new to VB. i require this urgently.

  10. #10
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    OK..

    I dont know how to do the mirroring of the text...
    Well you better install a reversed fonts (I dont know where you could find them.. though..)

    I will send you the rest of the code..
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  11. #11
    Addicted Member
    Join Date
    Nov 2002
    Posts
    155
    As far as I know, "TelePrompter" is a trade name; so be careful what you call this thing and check that you're not infringing any patents?

  12. #12
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    Create a text file C:\yourtxtfile.txt
    and put your text there...

    Press up arrow to scroll down and down to scroll up...
    left to accelerate and down to decelerate..

    Keep the keys pressed else it will stop...

    Inverting the fonts...

    Better install a inverted fonts and set it as the font for your picture box..

    Instead of picture box you could have very well used a text box..

    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private gmloop As Boolean
    4. Dim UpDown As Single
    5.  
    6. Private Sub Form_Load()
    7. Dim i As Integer
    8. Dim strStr As String
    9. Dim tmp As Long
    10. Dim st As String
    11.  
    12. Me.ScaleMode = 3
    13. Picture1.ScaleMode = 3
    14. Me.Show
    15. Picture1.CurrentX = 10
    16.  
    17. Open "C:\yourtxtfile.txt" For Input As #1
    18.     While Not EOF(1)
    19.         Line Input #1, st
    20.         strStr = strStr & vbCrLf & st
    21.     Wend
    22. Close #1
    23.  
    24. i = Picture1.ScaleHeight
    25. UpDown = 1
    26. While Not gmloop
    27.    
    28.     DoEvents
    29.     If GetTickCount - tmp > 50 Then
    30.         Picture1.Cls
    31.         tmp = GetTickCount
    32.         Picture1.CurrentY = UpDown
    33.         Picture1.Print strStr
    34.     End If
    35.    
    36. Wend
    37. End
    38. End Sub
    39.  
    40. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    41.     gmloop = True
    42. End Sub
    43.  
    44. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    45.     Select Case KeyCode
    46.         Case vbKeyUp
    47.             UpDown = UpDown + 1
    48.         Case vbKeyDown
    49.             UpDown = UpDown - 1
    50.         Case vbKeyLeft
    51.             UpDown = UpDown / 0.9
    52.         Case vbKeyRight
    53.             UpDown = UpDown / 1.1
    54.             If UpDown = 0 Then UpDown = 0.1
    55.     End Select
    56. End Sub
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  13. #13

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    the earlier coding which u sent was correct.it should scroll continously with the up and down arrow keys. But there is a problem here. when u load the text file all the contents of the file are loaded in a single line. how to word wrap the contents in a picturebox.

  14. #14

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    how to start and stop scrolling when i press space bar which i mentioned earlier.Once i press the space bar the text should scroll smoothly in the picturebox from bottom to top. this is done so that the news reader could read the scrolling text till the last line of text file. it is possible to stop the scrolling text in the middle. So in order to stop the scrolling text the space bar should be pressed. the space bar should be pressed again to continue scrolling.

  15. #15
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Ho.... Sorry..

    But I have to say that..

    You are making me do the next "teleprompter software".
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  16. #16
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Partially Done..

    Try this one....

    The wordwrap is also done.. but maybe you could improve the logic...

    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private gmloop As Boolean
    4. Dim UpDown As Single
    5. Dim mv As Integer
    6. Dim speed As Integer
    7.  
    8. Private Sub Form_Load()
    9. Dim i As Integer
    10. Dim strStr As String
    11. Dim tmp As Long
    12. Dim st As String
    13.  
    14. Me.ScaleMode = 3
    15. Picture1.ScaleMode = 3
    16. Me.Show
    17. Picture1.CurrentX = 10
    18. speed = 50
    19. Open "C:\yourtxtfile.txt" For Input As #1
    20.     While Not EOF(1)
    21.         Line Input #1, st
    22.         st = splt(st)
    23.         strStr = strStr & vbCrLf & st
    24.     Wend
    25. Close #1
    26. strStr = strStr & vbCrLf & " "
    27. i = Picture1.ScaleHeight
    28. UpDown = -1
    29. While Not gmloop
    30.    
    31.     DoEvents
    32.     If GetTickCount - tmp > speed Then
    33.         Picture1.Cls
    34.         tmp = GetTickCount
    35.         Picture1.CurrentY = i
    36.         Picture1.Print strStr
    37.         i = i + UpDown * mv
    38.        
    39.     End If
    40.    
    41. Wend
    42. End
    43. End Sub
    44. Private Function splt(strStr As String)
    45.     Dim l As Long
    46.     Dim tmpStr As String
    47.     Dim StrS As String
    48.     l = Len(strStr) * 10
    49.    
    50.     StrS = strStr
    51.     If l < Picture1.ScaleWidth Then splt = strStr: Exit Function
    52.    
    53.     For k = Picture1.ScaleWidth To l Step Picture1.ScaleWidth
    54.         tmpStr = Mid$(StrS, k / 10)
    55.         StrS = Mid$(StrS, 1, k / 10)
    56.         StrS = StrS & vbCrLf & tmpStr
    57.     Next
    58.     splt = StrS
    59. End Function
    60. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    61.     gmloop = True
    62. End Sub
    63.  
    64. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    65.     Select Case KeyCode
    66.         Case vbKeyUp
    67.             UpDown = -1
    68.         Case vbKeyDown
    69.             UpDown = 1
    70.         Case vbKeyLeft
    71.             speed = speed - 1
    72.             If speed < 5 Then speed = 5
    73.         Case vbKeyRight
    74.             speed = speed + 1
    75.             If speed > 500 Then speed = 500
    76.         Case vbKeySpace
    77.             mv = mv + 1
    78.             mv = mv Mod 2
    79.     End Select
    80. End Sub

    Regards,
    Pradeep
    Last edited by pradeepkrao; May 8th, 2003 at 06:34 AM.
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  17. #17
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    See this..

    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2.  
    3. Private gmloop As Boolean
    4. Dim UpDown As Single
    5. Dim mv As Integer
    6. Dim speed As Integer
    7.  
    8. Private Sub Form_Load()
    9. Dim i As Integer
    10. Dim strStr As String
    11. Dim tmp As Long
    12. Dim st As String
    13.  
    14. Me.ScaleMode = 3
    15. Picture1.ScaleMode = 3
    16. Me.Show
    17. Picture1.CurrentX = 10
    18. speed = 50
    19. Open "C:\yourtxtfile.txt" For Input As #1
    20.     While Not EOF(1)
    21.         Line Input #1, st
    22.         st = FormatText(st, 7)
    23.         st = splt(st)
    24.         strStr = strStr & vbCrLf & st
    25.     Wend
    26. Close #1
    27. strStr = strStr & vbCrLf & " "
    28. i = Picture1.ScaleHeight
    29. UpDown = -1
    30. While Not gmloop
    31.    
    32.     DoEvents
    33.     If GetTickCount - tmp > speed Then
    34.         Picture1.Cls
    35.         tmp = GetTickCount
    36.         Picture1.CurrentY = i
    37.         Picture1.Print strStr
    38.         i = i + UpDown * mv
    39.        
    40.     End If
    41.    
    42. Wend
    43. End
    44. End Sub
    45. Private Function splt(strStr As String)
    46.     Dim l As Long
    47.     Dim tmpStr As String
    48.     Dim StrS As String
    49.     l = Len(strStr) * 10
    50.    
    51.     StrS = strStr
    52.     If l < Picture1.ScaleWidth Then splt = strStr: Exit Function
    53.    
    54.     For k = Picture1.ScaleWidth To l Step Picture1.ScaleWidth
    55.         tmpStr = Mid$(StrS, k / 10)
    56.         StrS = Mid$(StrS, 1, k / 10)
    57.         StrS = StrS & vbCrLf & tmpStr
    58.     Next
    59.     splt = StrS
    60. End Function
    61. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    62.     gmloop = True
    63. End Sub
    64.  
    65. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    66.     Select Case KeyCode
    67.         Case vbKeyUp
    68.             UpDown = -1
    69.         Case vbKeyDown
    70.             UpDown = 1
    71.         Case vbKeyLeft
    72.             speed = speed - 1
    73.             If speed < 5 Then speed = 5
    74.         Case vbKeyRight
    75.             speed = speed + 1
    76.             If speed > 500 Then speed = 500
    77.         Case vbKeySpace
    78.             mv = mv + 1
    79.             mv = mv Mod 2
    80.     End Select
    81. End Sub
    82.  
    83. Private Function FormatText(sString As String, WordsPerLine As Integer) As String
    84.     Dim MyArray() As String, NewString As String
    85.    
    86.     NewString = Replace(sString, "  ", " ")
    87.     MyArray = Split(NewString, " ")
    88.     NewString = ""
    89.     For i = 0 To UBound(MyArray)
    90.         j = j + 1
    91.         If j > WordsPerLine Then
    92.             NewString = NewString & " " & MyArray(i) & "" & vbCrLf & ""
    93.             j = 0
    94.         Else
    95.             NewString = NewString & " " & MyArray(i)
    96.         End If
    97.     Next
    98.  
    99.     FormatText = NewString
    100. End Function
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  18. #18
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Wow.. finally i have done.. all your requirements...

    Have a look..

    There is mirror image of the text also...

    Regards,
    Pradeep
    Attached Files Attached Files
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  19. #19

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    everthing is working perfectly but why is the speed of the scrolling text so slow. even if i increase it to the maximum it is very slow.

  20. #20
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    Speed is controlled.. using left arrow and right arrow..

    what is your machine RAM and CPU Speed.

    I am able to control the speed...

    Happy Programming....

    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  21. #21

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    the speed could be controlled. but the scrolling text is not scrolling smoothly there is a jerk. the coding which u had first sent had a very smooth scrolling also the speed was very fast. please check up the first coding and see the difference which i meant even if the speed is increased.

  22. #22
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi Ayesha,

    Since I am reversing the Picture.. it is taking time..

    Please comment the code..

    for reversing and run..



    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  23. #23

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    So how do i solve the problem of scrolling speed by having both.

  24. #24
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi,

    You are indeed a Great Manager..
    I have to say it..

    Compromise on smoothness..
    VB Code:
    1. Private Declare Function GetTickCount& Lib "kernel32" ()
    2. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
    3. Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
    4.  
    5.  
    6. Private gmloop As Boolean
    7. Dim UpDown As Single
    8. Dim mv As Integer
    9. Dim speed As Single
    10.  
    11. Private Sub Form_Load()
    12. Dim i As Integer
    13. Dim strStr As String
    14. Dim tmp As Long
    15. Dim st As String
    16.  
    17. Me.ScaleMode = 3
    18. Picture1.ScaleMode = 3
    19. Me.Show
    20. Picture1.CurrentX = 250
    21. speed = 1
    22. Open "C:\yourtxtfile.txt" For Input As #1
    23.     While Not EOF(1)
    24.         Line Input #1, st
    25.         st = FormatText(st, 7)
    26.         st = splt(st)
    27.         strStr = strStr & vbCrLf & st
    28.     Wend
    29. Close #1
    30. strStr = strStr & vbCrLf & " "
    31. i = bg.ScaleHeight - 20
    32. UpDown = -1
    33. mv = 1
    34. While Not gmloop
    35.    
    36.     DoEvents
    37.     If GetTickCount - tmp > 100 Then
    38.         Picture1.Cls
    39.         bg.Cls
    40.         tmp = GetTickCount
    41.         bg.CurrentY = i
    42.         bg.Print strStr
    43.         bg.Refresh
    44.         drawInverse
    45.         i = i + UpDown * mv * speed
    46.        
    47.     End If
    48.    
    49. Wend
    50. End
    51. End Sub
    52. Private Sub drawInverse()
    53.     Dim i As Long
    54.     Dim j As Long
    55.     Dim k As Long
    56.     For i = 0 To Picture1.ScaleHeight
    57.         For j = 0 To Picture1.ScaleWidth
    58.        
    59.             k = GetPixel(bg.hdc, Picture1.ScaleWidth - j, i)
    60.            
    61.             If k <> vbBlack Then SetPixel Picture1.hdc, j, i, k
    62.            
    63.         Next
    64.     Next
    65.     Picture1.Refresh
    66. End Sub
    67. Private Function splt(strStr As String)
    68.     Dim l As Long
    69.     Dim tmpStr As String
    70.     Dim StrS As String
    71.     l = Len(strStr) * 10
    72.    
    73.     StrS = strStr
    74.     If l < Picture1.ScaleWidth Then splt = strStr: Exit Function
    75.    
    76.     For k = Picture1.ScaleWidth To l Step Picture1.ScaleWidth
    77.         tmpStr = Mid$(StrS, k / 10)
    78.         StrS = Mid$(StrS, 1, k / 10)
    79.         StrS = StrS & vbCrLf & tmpStr
    80.     Next
    81.     splt = StrS
    82. End Function
    83. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    84.     gmloop = True
    85. End Sub
    86.  
    87. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    88.     Select Case KeyCode
    89.         Case vbKeyUp
    90.             UpDown = -1
    91.         Case vbKeyDown
    92.             UpDown = 1
    93.         Case vbKeyLeft
    94.             speed = speed * 0.9
    95.            
    96.         Case vbKeyRight
    97.             speed = speed / 0.9
    98.         Case vbKeySpace
    99.             mv = mv + 1
    100.             mv = mv Mod 2
    101.     End Select
    102. End Sub
    103.  
    104. Private Function FormatText(sString As String, WordsPerLine As Integer) As String
    105.     Dim MyArray() As String, NewString As String
    106.    
    107.     NewString = Replace(sString, "  ", " ")
    108.     MyArray = Split(NewString, " ")
    109.     NewString = ""
    110.     For i = 0 To UBound(MyArray)
    111.         j = j + 1
    112.         If j > WordsPerLine Then
    113.             NewString = NewString & " " & MyArray(i) & "" & vbCrLf & ""
    114.             j = 0
    115.         Else
    116.             NewString = NewString & " " & MyArray(i)
    117.         End If
    118.     Next
    119.  
    120.     FormatText = NewString
    121. End Function
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  25. #25

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    this is still not smooth like how the original was.there is a jerk while scrolling

  26. #26

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    is it not possible to have a single picture box and obtain th mirror image of text in that picturebox. i had already mentioned that when the text is scrolling if i press F9 the mirror image of the text should appear and if i press F8 the original text should scroll.

  27. #27
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    I guess you can do it..

    If you need only one picture box , hide the other at runtime.

    i.e make
    VB Code:
    1. bg.visible = False

    To handle f9 f8 key inputs
    add few lines in the below code..

    vbKeyF8
    vbKeyF9


    Try learning from the code..
    VB Code:
    1. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    2.     Select Case KeyCode
    3.         Case vbKeyUp
    Last edited by pradeepkrao; May 9th, 2003 at 01:14 AM.
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  28. #28

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    but what about the speed in picture1. the speed in bg is correct if i remove drawinverse. now i want the same speed in picture1 by making bg.visible=false.

  29. #29

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    what happened to the question i asked u earlier.
    but what about the speed in picture1. the speed in bg is correct if i remove drawinverse. now i want the same speed in picture1 by making bg.visible=false.

    i have another problem. u have given a fixed statement for load a file. but it is not a fixed file name. when i say load text file My documents folder shuld open and i should be able to select a file for scrolling.this cannot be used.
    'Open "C:\My Documents\unity.txt" For Input As #1
    ' While Not EOF(1)
    ' Line Input #1, st

  30. #30
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405
    is this guy being paid or what?

    he seems to have pretty much written your entire app, and you still want more!


    there is helping with a problem and there is writing the thing for you. i think this is a case of the latter.

  31. #31
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Not even a 'please' or 'thank you'

    Just "I need"
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  32. #32
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Teleprompter

    Originally posted by ayesha16
    i am creating a teleprompter software. i want the following things
    no your not. apparently pradeepkrao is though

    have you ever written an application in your life?

  33. #33
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Ha ha ha ha

    Yeah kleinma I endedup in creating a new TelePrompter Software..
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  34. #34
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    Cool

    don't get me wrong since i've been using these forums i've asked for a lot of help, sometimes several times per project. but i always post as a last resort, and i always make sure i understand the answers posted.

    i certainly wouldn't do what this bloke has done on this thread and keep asking someone to write a program.

    i can't believe pradeepkrao put up with it. i would have been tempted to put some file deletes into the code just to check if ayesha16 actually understand the code before blindly running it. (but then i can be vindictive).

    by the way pradeepkrao i think your app is excellent.

  35. #35

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    Hi,

    thank u very much Mr.PradeepKRao for all the help. It is silly of me to keep on asking questions. But i cannot help it. B'coz i am new to VB i had to ask u. Actuallu i have various other features to be included in this software. What i asked u is only 25% of my project. Iam really sorry if i have hurt u by any means. But the code u had sent me was really helpful to a large extent. If u dont mind could u do a final favour for me.and i should be able to select a file for scrolling from the mydocuments folder instead of using a standard file.this cannot be used.
    'Open "C:\My Documents\unity.txt" For Input As #1
    ' While Not EOF(1)
    ' Line Input #1, st

    if it is possible please help me out with this alone and i would be very grareful to u.

  36. #36
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    by the way pradeepkrao i think your app is excellent.
    Thanks.

    ayesha16 dont feel bad, keep a positive attitude.

    Yes your requirement is use a file select feature..

    You may use a Common Dialog Control.

    You might be going Bonkers when I said Common Dialog Control.

    Any way I will do it and post it to you.

    I am basically jobless .

    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  37. #37
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Hi Ayesha,

    Check it out..

    I have learnt VB using this site.

    I joined this forum 2 years back and I dint even know how to Open a VB IDE forget about programming.

    I consider forums are the best place to learn.

    I suggest you to learn here.

    Regards,
    Pradeep

    There is no Shortcut for Hard Work
    Attached Files Attached Files
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  38. #38

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    thank u very much for the new code.but if command buttons are placed it is not possible to use the space bar,upand down arrow keys and right and left arrow keys. So i placed a menu bar and put the file select option in the menu bar. the run option i placed it in the enter key code. So this was working but the space bar was not working to stop and scroll again b'coz if i press the space bar the form gets unloaded. also i want the font size to be
    48 and font name should be Arial Black. if i do this change then the scrolling text apears jumbled up with overlapping letters and it starts scrolling from middle of the text file. so could u please suggest a remedy for this.

  39. #39
    Fanatic Member pradeepkrao's Avatar
    Join Date
    Sep 2001
    Location
    New Jersey
    Posts
    534

    Hi

    Please make sure that the focus is on the right Picture Box.

    Change the fot of the bg Picture box to whatever you want.

    See the code for its KeyDown event you might have to modify it..

    VB Code:
    1. Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
    2.     Select Case KeyCode
    3.         Case vbKeyUp
    4.             UpDown = -1
    5.         Case vbKeyDown
    6.             UpDown = 1
    7.         Case vbKeyLeft
    8.             speed = speed * 0.9
    9.            
    10.         Case vbKeyRight
    11.             speed = speed / 0.9
    12.         Case vbKeySpace ' This handles the Space key Press Event
    13.             mv = mv + 1
    14.             mv = mv Mod 2
    15.     End Select
    16. End Sub

    By the way are you a student or a proffesional. ?.

    Regards,
    Pradeep
    Learn by others experience as you cannot live long to experience them all.
    www.freewebs.com/pradeepkrao

    LOOK AT MY GAMES AT MY WEB SITE.

  40. #40

    Thread Starter
    Member
    Join Date
    May 2003
    Location
    India
    Posts
    37
    sorry to tell u but this doesn't work if i increase the font size

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width