|
-
Apr 25th, 2001, 04:30 PM
#1
Thread Starter
Addicted Member
real quick 1
ok I have had this
run1 = 1
R1.text = run1
but now I want it to show up as a picture unstead of just a number so I want to do this
if r1.text = 1 then
r1.text = c:\tec\r1-1.bmp
end if
and so on for 28 scenarios
can I keep it a text box or does it have to be a picture box
if I make it a picture box how do I make a value you for it????
like this???
run1 = 1
r1.picturebox = 1
if r1.picturebox = 1 then
r1.picture = c:\tec\r1-1.bmp?????
I tried above and got alot of erros
-
Apr 25th, 2001, 04:35 PM
#2
_______
<?>
???????????????
Code:
If r1.Text = 1 Then
r1.Text = "c:\tec\r1-1.bmp"
End If
run1 = 1
r1.PictureBox = 1
If r1.PictureBox = 1 Then
Set r1.Picture.Picture = LoadPicture(r1.Text)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 04:37 PM
#3
Thread Starter
Addicted Member
I told you it was easy
Wyne thanks for you help I told you I was stupid
still learning
Thanks,
Matt
-
Apr 25th, 2001, 04:42 PM
#4
_______
<?>
As long as one is inquiring, there is no such thing as stupid..just under exposed...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 04:46 PM
#5
Thread Starter
Addicted Member
1 last thing
ok wayne 1 more thing I did this
no the text box where I want the pic to show up is says"c:\tecmo\r1-0.bmp" not the pic
so does that mean I can have a text box it must be a pic box or do i need both???
Private Sub r1_Change()
If r1.Text = "0" Then
r1.Text = "c:\tecmo\r1-0.bmp"
End If
If r1.Text = "1" Then
r1.Text = "c:\tecmo\r1-1.bmp"
End If
If r1.Text = "2" Then
r1.Text = "c:\tecmo\r1-2.bmp"
End If
If r1.Text = "3" Then
r1.Text = "c:\tecmo\r1-3.bmp"
End If
If r1.Text = "4" Then
r1.Text = "c:\tecmo\r1-4.bmp"
End If
If r1.Text = "5" Then
r1.Text = "c:\tecmo\r1-5.bmp"
End If
If r1.Text = "6" Then
r1.Text = "c:\tecmo\r1-6.bmp"
End If
If r1.Text = "7" Then
r1.Text = "c:\tecmo\r1-7.bmp"
End If
End Sub
thanks again
Matt
-
Apr 25th, 2001, 04:51 PM
#6
_______
<?>
You are using the location posted into the text box to call the file to the picture box...you need both...
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 04:51 PM
#7
Thread Starter
Addicted Member
1 last thing
ok wayne 1 more thing I did this
no the text box where I want the pic to show up is says"c:\tecmo\r1-0.bmp" not the pic
so does that mean I can have a text box it must be a pic box or do i need both???
Private Sub r1_Change()
If r1.Text = "0" Then
r1.Text = "c:\tecmo\r1-0.bmp"
End If
If r1.Text = "1" Then
r1.Text = "c:\tecmo\r1-1.bmp"
End If
If r1.Text = "2" Then
r1.Text = "c:\tecmo\r1-2.bmp"
End If
If r1.Text = "3" Then
r1.Text = "c:\tecmo\r1-3.bmp"
End If
If r1.Text = "4" Then
r1.Text = "c:\tecmo\r1-4.bmp"
End If
If r1.Text = "5" Then
r1.Text = "c:\tecmo\r1-5.bmp"
End If
If r1.Text = "6" Then
r1.Text = "c:\tecmo\r1-6.bmp"
End If
If r1.Text = "7" Then
r1.Text = "c:\tecmo\r1-7.bmp"
End If
End Sub
thanks again
Matt
-
Apr 25th, 2001, 04:52 PM
#8
Hyperactive Member
I'm not sure what you are trying to do?? You cannot load a picture into a textbox (at least not without some special API call ?!?), you can however put text into a picturebox:
Picture1.Print "Hello"
or
Picture1.Print 23532
To load a picture into a picturebox, use:
Picture1.Picture = LoadPicture("C:\MyPicture.bmp")
If you need to assign a value to a picturebox and read it back later, then use the tag property:
Picture1.Tag = 1024
If Picture1.Tag = 1024 Then dosomething
You had mentioned:
and so on for 28 scenarios
If you are processing a grid of boxes or something in which there are first numbers for each picture, then pictures when the user does something, then consider using a control array:
Set the Index property for each picturebox to a number 0-27 (28 different pictureboxes), then loop through them to do something:
Code:
For MyCounter = 0 to Ubound(Picture1)
Picture1(MyCounter).Picture = ........
Picture1(MyCounter).Print ..........
.
.
'Processing Code
.
.
Next MyCounter
I hope something here helped !!!!
-
Apr 25th, 2001, 05:00 PM
#9
_______
<?>
Simplymattb
Did you get it...when you do zip it and attach it...I don't think you need all those If statements....but I need to see what you are doing.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 05:03 PM
#10
Thread Starter
Addicted Member
thanks
wayne zip it and attach it why you want to look at it????? I will if you want??????
well here is what I did and this is what was wrong
the said "object doesnt support this property or method" ?????
Get #1, run1n2off + 1, nu
run1.Tag = Hex(Int(Asc(nu) / &H10)) 'The x in &Hxy
If run1.Tag = "0" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-0.bmp")
End If
If run1.Tag = "1" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-1.bmp")
End If
If run1.Tag = "2" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-2.bmp")
End If
If run1.Tag = "3" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-3.bmp")
End If
If run1.Tag = "4" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-4.bmp")
End If
If run1.Tag = "5" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-5.bmp")
End If
If run1.Tag = "6" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-6.bmp")
End If
If run1.Tag = "7" Then
Set run1.Picture.Picture = LoadPicture("c:\tecmo\r1-7.bmp")
End If
-
Apr 25th, 2001, 05:09 PM
#11
_______
<?>
Assuming run1 = the name of the picturebox
you had too many picture(s)
Set run1.Picture = LoadPicture("c:\tecmo\r1-0.bmp")
Private Sub Command1_Click()
Get #1, run1n2off + 1, nu
run1.Tag = Hex(Int(Asc(nu) / &H10)) 'The x in &Hxy
If run1.Tag = "0" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-0.bmp")
End If
If run1.Tag = "1" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-1.bmp")
End If
If run1.Tag = "2" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-2.bmp")
End If
If run1.Tag = "3" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-3.bmp")
End If
If run1.Tag = "4" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-4.bmp")
End If
If run1.Tag = "5" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-5.bmp")
End If
If run1.Tag = "6" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-6.bmp")
End If
If run1.Tag = "7" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-7.bmp")
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 05:18 PM
#12
Thread Starter
Addicted Member
it worked
hey wayne it worked THANKS SO MUCH!!!!
one last thing can I make it so that the pic fits into the pic box cause the pic is a little to big and I dont want to edit a bunch of them so I want to set the pic size by the box then make the pic fit in the box????? but not just the upper corner I mean the whole thing
Can this be done
Thanks,
Matt
-
Apr 25th, 2001, 05:54 PM
#13
_______
<?>
Use an image box instead of a picture box and set the stretch property to true..then it will resize to fit the box..the load code is the same..
Set Image1.picture = LoadPicture("c:\mypic.jpg")
Have fun'
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Apr 25th, 2001, 09:06 PM
#14
Hyperactive Member
If you wanted to clean this up a little, you could build the Bitmap File Name using the Tag property, then you wouldn't need so many lines of code:
Assuming run1 = the name of the picturebox
you had too many picture(s)
Set run1.Picture = LoadPicture("c:\tecmo\r1-0.bmp")
Private Sub Command1_Click()
Get #1, run1n2off + 1, nu
run1.Tag = Hex(Int(Asc(nu) / &H10)) 'The x in &Hxy
Set run1.Picture = LoadPicture("c:\tecmo\r1-" & Format(run1.Tag) & ".bmp")
End Sub
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
|