Results 1 to 6 of 6

Thread: um..scrolling within a pic box

  1. #1

    Thread Starter
    Lively Member Supreme Cookie's Avatar
    Join Date
    Nov 2002
    Location
    A small box
    Posts
    109

    Exclamation um..scrolling within a pic box

    How would I get the text from a pic box to print in a text box...?
    Last edited by Supreme Cookie; Jun 10th, 2003 at 04:43 PM.

  2. #2
    Fanatic Member Armbruster's Avatar
    Join Date
    Sep 2002
    Location
    Maryland Heights, MO
    Posts
    857
    Text in a picture box or on a form is drawn on the on the control as a graphic. Once you "print" on the picture box, it is no longer text, but a "picture" of the text.
    "Look! Up in the sky! It's a bird! It's a plane! It's Diaper-Head Boy! (there by my name!) Yes, Diaper-Head Boy, who disguised as my son, Seth, fights a never-ending battle for truth, justice and terrorizing my house!

    Resistance is futile, you will be compiled . . . Please!

  3. #3

    Thread Starter
    Lively Member Supreme Cookie's Avatar
    Join Date
    Nov 2002
    Location
    A small box
    Posts
    109
    Hmmm..so i've noticed well i reverted to my original idea of putting in scroll bars but it doesn't seem to be working, i got the code from one of the other posts, but it doesn't see to me working wih text, like it doesn't realize that the text is past the border here is the code i used..

    VB Code:
    1. Private Sub CmdBack_Click()
    2. FrmRecall.Hide
    3. FrmStore.Show
    4. End Sub
    5.  
    6. Private Sub CmdGet_Click()
    7.  Call DisplayFile
    8. End Sub
    9.  
    10. Private Sub DisplayFile()
    11.  Dim recordNum As Integer
    12.  Dim Question As QuestAns
    13.  
    14.  Open "C:\Questions.txt" For Random As #1 Len = Len(Question)
    15.  
    16.  PicResult2.Cls
    17.    
    18.  For recordNum = 1 To LOF(1) / Len(Question)
    19.   Get #1, recordNum, Question
    20.    PicResult2.Print "Question "; recordNum
    21.    PicResult2.Print "==>"; Question.Question; Chr(13); Tab(7); Question.Ans1; Chr(13); Tab(7); Question.Ans2; Chr(13); Tab(7); Question.Ans3; Chr(13); Tab(7); Question.Ans4
    22.   Next recordNum
    23.  Close #1
    24.  
    25. End Sub
    26.  
    27.  
    28. Private Sub Form_Load()
    29. Call SetPicSize
    30. End Sub
    31.  
    32. Sub SetPicSize()
    33.     ' Ok, the way this works is you've got two pictureboxes, Picture1
    34.     ' and picture2. Picture2 is inside of Picture1 and holds the
    35.     ' picture that will be seen. First we check to see how big
    36.     ' Picture2 is. If it's bigger then Picture1, then we'll have to
    37.     ' use the scrollbars.
    38.     If PicResult2.ScaleWidth > PicResult1.ScaleWidth Then
    39.         HScroll1.Enabled = True
    40.         HScroll1.Max = PicResult2.ScaleWidth - PicResult1.ScaleWidth
    41.         HScroll1.LargeChange = Int(HScroll1.Max \ 25) + 1
    42.         HScroll1.SmallChange = Int(HScroll1.Max \ 200) + 1
    43.     Else
    44.         HScroll1.Enabled = False
    45.     End If
    46.    
    47.     If PicResult2.ScaleHeight > PicResult1.ScaleHeight Then '
    48.         VScroll1.Enabled = True
    49.         VScroll1.Max = PicResult2.ScaleHeight - PicResult1.ScaleHeight
    50.         VScroll1.LargeChange = Int(VScroll1.Max \ 25) + 1
    51.         VScroll1.SmallChange = Int(VScroll1.Max \ 200) + 1
    52.     Else
    53.         VScroll1.Enabled = False
    54.     End If
    55. End Sub
    56.  
    57. Private Sub HScroll1_Change()
    58.     ' Change the width and position of Picture2
    59.     PicResult2.Width = PicResult2.Width + HScroll1.Value
    60.     PicResult2.Left = 0 - HScroll1.Value
    61. End Sub
    62.  
    63. Private Sub VScroll1_Change()
    64.     ' Change the height and position of Picture2
    65.     PicResult2.Height = PicResult2.Height + VScroll1.Value
    66.     PicResult2.Top = 0 - VScroll1.Value
    67. End Sub

  4. #4

    Thread Starter
    Lively Member Supreme Cookie's Avatar
    Join Date
    Nov 2002
    Location
    A small box
    Posts
    109

    Unhappy

    come on ppl plz help someone??? anyone???

  5. #5

    Thread Starter
    Lively Member Supreme Cookie's Avatar
    Join Date
    Nov 2002
    Location
    A small box
    Posts
    109
    ??? no one?????

  6. #6

    Thread Starter
    Lively Member Supreme Cookie's Avatar
    Join Date
    Nov 2002
    Location
    A small box
    Posts
    109
    bump....please anyone

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