Discussion:
Array with picture boxes
(too old to reply)
BIAF
2004-08-02 02:21:31 UTC
Permalink
Hi,

FOR j% = 1 to 9
LOAD picture1(j%)
NEXT j%

how do i make thease picture boxes lay out side by side rather than on
top of each other.
Derek Ross
2004-08-02 15:22:35 UTC
Permalink
Post by BIAF
Hi,
FOR j% = 1 to 9
LOAD picture1(j%)
NEXT j%
how do i make thease picture boxes lay out side by side rather than on
top of each other.
I don't have a copy of VBDOS on this machine but I would imagine that
something similar to

FOR j% = 1 to 9
LOAD picture1(j%)
picture1(j%).Left = j% * 7 + 5
picture1(j%).Width = 10
NEXT j%

would do the job.

Cheers

Derek
Dan Barclay
2004-08-02 19:01:00 UTC
Permalink
VBDOS cannot do graphics with the forms engine. It is a character mode
operation only.

If you want to do graphics with VBDOS you have to switch to a graphics
screen and handle it manually, or get a graphics library.

Dan
Post by Derek Ross
Post by BIAF
Hi,
FOR j% = 1 to 9
LOAD picture1(j%)
NEXT j%
how do i make thease picture boxes lay out side by side rather than on
top of each other.
I don't have a copy of VBDOS on this machine but I would imagine that
something similar to
FOR j% = 1 to 9
LOAD picture1(j%)
picture1(j%).Left = j% * 7 + 5
picture1(j%).Width = 10
NEXT j%
would do the job.
Cheers
Derek
Derek Ross
2004-08-03 02:39:32 UTC
Permalink
Post by Derek Ross
Post by BIAF
Hi,
FOR j% = 1 to 9
LOAD picture1(j%)
NEXT j%
how do i make thease picture boxes lay out side by side rather than on
top of each other.
I don't have a copy of VBDOS on this machine but I would imagine that
something similar to
FOR j% = 1 to 9
LOAD picture1(j%)
picture1(j%).Left = j% * 7 + 5
picture1(j%).Width = 10
NEXT j%
would do the job.
In fact a little testing shows that a Form1.frm file containing ...

Version 1.00
BEGIN Form Form1
AutoRedraw = 0
BackColor = QBColor(7)
BorderStyle = 2
Caption = "Form1"
ControlBox = -1
Enabled = -1
ForeColor = QBColor(0)
Height = Char(17)
Left = Char(15)
MaxButton = -1
MinButton = -1
MousePointer = 0
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(63)
WindowState = 0
BEGIN PictureBox Picture1
AutoRedraw = 0
BackColor = QBColor(7)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(0)
Height = Char(5)
Index = 0
Left = Char(0)
MousePointer = 0
TabIndex = 0
TabStop = -1
Tag = ""
Top = Char(0)
Visible = -1
Width = Char(12)
END
END

SUB Form_Load ()

LET picture1(0).Left = 2
LET picture1(0).Top = 1
LET picture1(0).Width = 10
LET picture1(0).Visible = -1
FOR j% = 1 TO 9
LOAD picture1(j%)
LET picture1(j%).Left = j% * 5 + 2
LET picture1(j%).Top = j% + 1
LET picture1(j%).Width = 10
LET picture1(j%).Visible = -1
NEXT j%

END SUB

... will do the job Just Fine.

Cheers

Derek
BIAF
2004-08-03 10:34:40 UTC
Permalink
Hi,



form load :

LET picture1(0).Left = 1
LET picture1(0).Top = 1
LET picture1(0).Width = 8
LET picture1(0).Visible = -1

command1 click :

FOR j% = 1 TO 3 - 1
LOAD media.picture1(j%)
LET picture1(j%).Left = j% * 1 + 8
LET picture1(j%).Visible = -1

heres how it looks now after trying to get it close to what i want:

________ ___________
| | | | | |
| | | | | |
| | | | | |
| | | | | |
````````` ````````````

the first two are fine, but as you can see, the 3rd and 4th box are
over lapping, I want the 3rd and 4th box to be on over to the right so
there matching the first two like this :


________ ________ ________ ________
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
````````` ````````` ````````` `````````

can this be done?
thx
Derek Ross
2004-08-03 18:35:28 UTC
Permalink
Post by BIAF
Hi,
LET picture1(0).Left = 1
LET picture1(0).Top = 1
LET picture1(0).Width = 8
LET picture1(0).Visible = -1
FOR j% = 1 TO 3 - 1
LOAD media.picture1(j%)
LET picture1(j%).Left = j% * 1 + 8
LET picture1(j%).Visible = -1
________ ___________
| | | | | |
| | | | | |
| | | | | |
| | | | | |
````````` ````````````
the first two are fine, but as you can see, the 3rd and 4th box are
over lapping, I want the 3rd and 4th box to be on over to the right so
________ ________ ________ ________
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
````````` ````````` ````````` `````````
can this be done?
It's straightforward. Just change ...

LET picture1(j%).Left = j% * 1 + 8

... to ...

LET picture1(j%).Left = j% * 8 + 1

Cheers

Derek
BIAF
2004-08-03 23:38:03 UTC
Permalink
lol, thanks,

Now that im been told that i cant do much graphics with picbox's in
vbdos, can i even print to it, i kinda knew there was no real graphic
relation with this object as to the vb6 one but i did think i could do
ascii or somethin to it? lets say i want to print the text '123' to
the picbox, how. And how about printing pixel by pixel to the pic box
or is only one chr per line etc?

cheers again for last help.
Derek Ross
2004-08-05 14:24:21 UTC
Permalink
Post by BIAF
lol, thanks,
Now that im been told that i cant do much graphics with picbox's in
vbdos, can i even print to it, i kinda knew there was no real graphic
relation with this object as to the vb6 one but i did think i could do
ascii or somethin to it? lets say i want to print the text '123' to
the picbox, how. And how about printing pixel by pixel to the pic box
or is only one chr per line etc?
Yes, you can print characters to it by using

picture1.Print "123"

But pixel by pixel isn't possible.

Cheers

Derek
Dan Barclay
2004-08-05 20:53:46 UTC
Permalink
You may want to look at Graphic Quick Screen or some similar product instead
of using the VBDOS forms engine.

http://www.ethanwiner.com/p_qscr.htm

Ethan Winer owned Crescent software and sold their Windows products some
time back. He kept the DOS products and still sells and supports them.
Ethan is a regular here as well.

Dan
Post by BIAF
lol, thanks,
Now that im been told that i cant do much graphics with picbox's in
vbdos, can i even print to it, i kinda knew there was no real graphic
relation with this object as to the vb6 one but i did think i could do
ascii or somethin to it? lets say i want to print the text '123' to
the picbox, how. And how about printing pixel by pixel to the pic box
or is only one chr per line etc?
cheers again for last help.
Loading...