Re: Mike: Indices in separate picture boxes
- From: Randy Gardner <RandyGardner@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 10:31:01 -0700
Hi Mike:
You make a good point especially when it come to sending the data to
different objects like the printer.
I'm going to study your code example a little more.
If I have some questions I will generate a new post, please watch for my name.
Your knowledge is greatly appreciated!!
--
Thank you,
Randy
"Mike Williams" wrote:
Randy Gardner wrote:.
I will only have 2 indexes, one in X and one in Y
I wasn't quite sure what you meant in your previous post when you
mentioned wanting to have separate indexes, but it appears that you
want to have separate picture boxes for the numbers and the text that
will appear at the left side and the bottom edge of your graph, so that
you have just the graph itself (the grid lines and the plotted points
or curves) in the main picture box. In other words you want to have
three separate picture boxes to create the entire graph. Presumably you
want to do that in order to gain the simplicity of having a user
ScaleMode in the main picture box that is specified simply using the
min and max values of the data. I personally wouldn't advise you to do
it that way, because the added complication of tying up the two small
picture boxes to the main one will take away any benefit you might have
otherwise obtained. Also, the picture box at the left side is going to
need to be slightly "taller" than the main picture box (otherwise the
digits against the top grid line will be partially missing because it
really needs to be centralised around the highest grid line). There
will be similar problems with the lower picture box in respect of its
width. Then of course you'll have to worry about the "blank gaps" that
will be present if the backcolor of the main picture box is not the
same as the backcolour of the object on which it sits. And if you're
going to avoid all this by drawing your graph in the main picture box
so that the grid lines don't quite fill the box then you're back to
where you started (in terms of no longer having nice easy ScaleWidths
and ScaleHeights that exactly match your data maximums) and so you
might as well have left it as it was in the first place. Also you will
have to ensure that the text items in the two smaller picture boxes
line up correctly against the grid lines in the main graph whether
those text items are in separate picture boxes or not (forget about
your suggestion of using a vbCharacter scalemode, for reasons which
I'll come to later in this message). So you'll still have to keep the
code that calculates the width and or height and position of each text
item in order to align it correctly, but this time you're doing it in
two separate picture boxes, which makes it more difficult instead of
easier.
Also, what are you going to do when the time comes to send your
complete graph to the printer? You'll then have three separate controls
(or possibly more) to deal with to print the graph, and you will still
have to perform various calculations on all the graph data before
printing it (calculations that you did not have to perform in the
picture box) because you will have to allow for the fact that the graph
is almost certainly not required to go to the top left of the printer
page (as it does in the picture box) and in addition to that you will
still have to perform extra calculations to allow for the variable
unprintable margins of the currently selected printer if you want the
output correctly positioned. Add to that the fact that the ScaleMode of
the printer (or other desired output device) will almost certainly not
match the "User ScaleMode" of your picture box unless you make it so
because your graph is the only thing you are printing on that page
(unless you fiddle with the printer ScaleModes mid page, which would
only add further complication). And then you've got the messing about
getting the size of the printed output correct as well. And you've
got all this to do in three separate picture boxes. So, the apparent
gain in simplicity you achieved by using one picture box for your
actual graph grid and curves and two others for the rest of the stuff
will come back to haunt you with a vengeance when you want to print the
thing to the printer (or anywhere else). I would strongly advise
against going down that road.
If I want to change the backcolor or change the forecolor
of any it is one instruction.
You can change the back colour of any part of the "all in one picture
box" graph with very little code, and you can change the forecolour of
the text or other parts just as easily. Once you've got the basic
building block going you can add anything you want with very little
extra code.
and I can use vbCharacters scalemode for setting
the indices displays.
The vbCharacters scalemode is not what you appear to think it is. It
uses fixed size units (in the same way that inches and centimeters are
fixed size units). In this context, vbCharacters sets your scale so
that each unit is one twelfth of an inch in the horizontal direction
and one sixth of an inch in the vertical direction. For example, if you
have a picture box that is 5 inches wide and 5 inches high and you set
its ScaleMode to vbCharacters the picture box wll be 60 scale units
wide and 30 scale units high. It's got nothing at all to do with the
actual size of any characters you may be using. The vbCharacters
ScaleMode is about as much use as a chocolate teapot!
Don't forget that the code I posted about a week ago (the routine that
draws a 30 x 75 graph containing some grid lines and numbers and a
couple of test circles) was deliberately written in a very "long
winded" way in the hope that it might be easier for you to pick it up
piece by piece. It is easily possible to write it in a neater way,
using less code, and when that is done, and when all the explanatory
remarks are removed, it will be quite a small routine and will be
fairly easy to modify to do other things. Also, from the perspective of
the calling routine, it is a very simple function to use. You just pass
it the desired physical size of the graph you want to draw, the object
you want to draw it to (printer, form, or picture box), and the desired
position you want to draw it on that object.
It's up to you what you do of course, and if you want to go down the
"three or more picture boxes" road then feel free to do so. But
personally I would strongly advise against it.
Thanks again for your help.
You're welcome.
Mike
- Follow-Ups:
- Re: Mike: Indices in separate picture boxes
- From: Mike Williams
- Re: Mike: Indices in separate picture boxes
- References:
- Re: Custom ScaleMode setting problem
- From: Mike Williams
- Re: Mike: it's Working, more explanation Please.
- From: Randy Gardner
- Re: Mike: it's Working, more explanation Please.
- From: Mike Williams
- Re: Mike: Better informed, Fundamental questions
- From: Randy Gardner
- Re: Mike: Better informed, Fundamental questions
- From: Mike Williams
- Re: Mike: Restating your explanation
- From: Randy Gardner
- Re: Mike: Restating your explanation
- From: Mike Williams
- Re: Mike: One last explanation, I hope!
- From: Randy Gardner
- Re: Mike: One last explanation, I hope!
- From: Mike Williams
- Re: Mike: One last explanation, I hope!
- From: James Parsly
- Re: Mike: One last explanation, I hope!
- From: Mike Williams
- Re: Mike: One last explanation, I hope!
- From: Randy Gardner
- Re: Mike: One last explanation, I hope!
- From: Mike Williams
- Re: Mike: Indices in separate picture boxes
- From: Randy Gardner
- Re: Mike: Indices in separate picture boxes
- From: Mike Williams
- Re: Custom ScaleMode setting problem
- Prev by Date: Re: FileSystemObject problem
- Next by Date: Re: error using a ms access database ith visual basic 6
- Previous by thread: Re: Mike: Indices in separate picture boxes
- Next by thread: Re: Mike: Indices in separate picture boxes
- Index(es):
Relevant Pages
|