|
-
Jun 10th, 2003, 03:42 PM
#1
Thread Starter
Lively Member
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.
-
Jun 10th, 2003, 04:23 PM
#2
Fanatic Member
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!
-
Jun 10th, 2003, 04:41 PM
#3
Thread Starter
Lively Member
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:
Private Sub CmdBack_Click()
FrmRecall.Hide
FrmStore.Show
End Sub
Private Sub CmdGet_Click()
Call DisplayFile
End Sub
Private Sub DisplayFile()
Dim recordNum As Integer
Dim Question As QuestAns
Open "C:\Questions.txt" For Random As #1 Len = Len(Question)
PicResult2.Cls
For recordNum = 1 To LOF(1) / Len(Question)
Get #1, recordNum, Question
PicResult2.Print "Question "; recordNum
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
Next recordNum
Close #1
End Sub
Private Sub Form_Load()
Call SetPicSize
End Sub
Sub SetPicSize()
' Ok, the way this works is you've got two pictureboxes, Picture1
' and picture2. Picture2 is inside of Picture1 and holds the
' picture that will be seen. First we check to see how big
' Picture2 is. If it's bigger then Picture1, then we'll have to
' use the scrollbars.
If PicResult2.ScaleWidth > PicResult1.ScaleWidth Then
HScroll1.Enabled = True
HScroll1.Max = PicResult2.ScaleWidth - PicResult1.ScaleWidth
HScroll1.LargeChange = Int(HScroll1.Max \ 25) + 1
HScroll1.SmallChange = Int(HScroll1.Max \ 200) + 1
Else
HScroll1.Enabled = False
End If
If PicResult2.ScaleHeight > PicResult1.ScaleHeight Then '
VScroll1.Enabled = True
VScroll1.Max = PicResult2.ScaleHeight - PicResult1.ScaleHeight
VScroll1.LargeChange = Int(VScroll1.Max \ 25) + 1
VScroll1.SmallChange = Int(VScroll1.Max \ 200) + 1
Else
VScroll1.Enabled = False
End If
End Sub
Private Sub HScroll1_Change()
' Change the width and position of Picture2
PicResult2.Width = PicResult2.Width + HScroll1.Value
PicResult2.Left = 0 - HScroll1.Value
End Sub
Private Sub VScroll1_Change()
' Change the height and position of Picture2
PicResult2.Height = PicResult2.Height + VScroll1.Value
PicResult2.Top = 0 - VScroll1.Value
End Sub
-
Jun 10th, 2003, 05:05 PM
#4
Thread Starter
Lively Member
-
Jun 11th, 2003, 05:38 AM
#5
Thread Starter
Lively Member
-
Jun 11th, 2003, 04:42 PM
#6
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|