From: David on
I have multiple pictureboxes.
Picturebox 0 is design and the rest are created at run time.
I want to draw three line in picturebox 0.
Prior to drawing I update my structure

Type TPBox(PBoxNumber)
LineNo As Long
FirstInPBox As Boolean
End Type

For the 1st line I set "FirstInPBox = True" (this controls
the scale values)
For the Second and Third Lines I just draw the lines
All works well.

=================
I now wish to move one of the lines to Box "1".
If it is LineNo 2 or 3, I just delete the LineNo Reference
for PBox 0 and put it into the PBox1 Structure and Also
Set the FirstInPbox = True.

However, If I move Line #1 to PBox1, I loose "FirstInPBox = True"
which controls the Scale, which forces me to loop through the
structure and update the next line number to use as the scale for PBox 0.

Anyone got a better or easier way?







From: Bob Butler on

"David" <NoWhere(a)earthlink.net> wrote in message
news:%23GFErW3qKHA.3908(a)TK2MSFTNGP05.phx.gbl...
>I have multiple pictureboxes.
> Picturebox 0 is design and the rest are created at run time.
> I want to draw three line in picturebox 0.
> Prior to drawing I update my structure
>
> Type TPBox(PBoxNumber)

You can't declare a type as an array like that so that isn't valid VB code

> LineNo As Long
> FirstInPBox As Boolean
> End Type
>
> For the 1st line I set "FirstInPBox = True" (this controls
> the scale values)
> For the Second and Third Lines I just draw the lines
> All works well.
>
> =================
> I now wish to move one of the lines to Box "1".
> If it is LineNo 2 or 3, I just delete the LineNo Reference
> for PBox 0 and put it into the PBox1 Structure and Also
> Set the FirstInPbox = True.

I've read this post several times and have no idea what you are doing or
what you are having trouble with. "delete the LineNo Reference for PBox 0"
doesn't make sense unles syou mean you're just setting it to 0.

> However, If I move Line #1 to PBox1, I lo[o]se "FirstInPBox = True"

How are you "moving" a line from one picturebox to another? If what you're
doing changes the contents of an element in an array of TPBox types then
your code must be doing that.

> which controls the Scale, which forces me to loop through the
> structure and update the next line number to use as the scale for PBox 0.

I think you need to post actual code that demonstrates the problem and/or
clarify the question.

From: David on
Mr. Butler:
Thanks for taking a look see.

First your correct on this declare

>> Type TPBox(PBoxNumber)
>
> You can't declare a type as an array like that so that isn't valid VB code
>

My error, was trying to cut corners and show that the structure was an
array.

======================

There is a lot of code (many procedures) so difficult to post.
========================

Bottom line is I'm trying to track different objects (e.g. lines) which can
be drawn and moved -- at user selection -- between different pictureboxes.

Since the first line drawn in each picturebox determines the scale for the
picturebox, the movement of that line to a "new" picturebox would corrupt
any other lines in the "old" picturebox.

Looking for a simple yet effective method to do this.


"Bob Butler" <noway(a)nospam.ever> wrote in message
news:eOYcoi3qKHA.4220(a)TK2MSFTNGP05.phx.gbl...
>
> "David" <NoWhere(a)earthlink.net> wrote in message
> news:%23GFErW3qKHA.3908(a)TK2MSFTNGP05.phx.gbl...
>>I have multiple pictureboxes.
>> Picturebox 0 is design and the rest are created at run time.
>> I want to draw three line in picturebox 0.
>> Prior to drawing I update my structure
>>
>> Type TPBox(PBoxNumber)
>
> You can't declare a type as an array like that so that isn't valid VB code
>
>> LineNo As Long
>> FirstInPBox As Boolean
>> End Type
>>
>> For the 1st line I set "FirstInPBox = True" (this controls
>> the scale values)
>> For the Second and Third Lines I just draw the lines
>> All works well.
>>
>> =================
>> I now wish to move one of the lines to Box "1".
>> If it is LineNo 2 or 3, I just delete the LineNo Reference
>> for PBox 0 and put it into the PBox1 Structure and Also
>> Set the FirstInPbox = True.
>
> I've read this post several times and have no idea what you are doing or
> what you are having trouble with. "delete the LineNo Reference for PBox
> 0" doesn't make sense unles syou mean you're just setting it to 0.
>
>> However, If I move Line #1 to PBox1, I lo[o]se "FirstInPBox = True"
>
> How are you "moving" a line from one picturebox to another? If what
> you're doing changes the contents of an element in an array of TPBox types
> then your code must be doing that.
>
>> which controls the Scale, which forces me to loop through the
>> structure and update the next line number to use as the scale for PBox 0.
>
> I think you need to post actual code that demonstrates the problem and/or
> clarify the question.
>


From: Bob Butler on

"David" <NoWhere(a)earthlink.net> wrote in message
news:OSXC1c4qKHA.5936(a)TK2MSFTNGP04.phx.gbl...
> Mr. Butler:
> Thanks for taking a look see.
>
> First your correct on this declare
>
>>> Type TPBox(PBoxNumber)
>>
>> You can't declare a type as an array like that so that isn't valid VB
>> code
>>
>
> My error, was trying to cut corners and show that the structure was an
> array.
>
> ======================
>
> There is a lot of code (many procedures) so difficult to post.
> ========================
>
> Bottom line is I'm trying to track different objects (e.g. lines) which
> can be drawn and moved -- at user selection -- between different
> pictureboxes.
>
> Since the first line drawn in each picturebox determines the scale for the
> picturebox, the movement of that line to a "new" picturebox would corrupt
> any other lines in the "old" picturebox.
>
> Looking for a simple yet effective method to do this.

OK, setting aside how to do it for a moment... I as a user draw a few lines
on the first PB, a couple on the second, and none on the third...

Now I "move" the first line from the first PB to the second (which already
has some)
-- what happens on the first PB? does the second line drawn now become the
basis for scaling? Does the first line remain since it set the scale?
-- what happens on the second PB? does the line being moved get re-scaled
to fit the scale already set or does it become the new "first" line and
cause whatever is there already to be rescaled?

If I move the line to the third PB instead (which has nothing already) I'd
assume it would become the first line there but the question of what happens
on the first PB still holds?

I'm unclear how one line defines scale for the others but it one line is
different than all others in a set then I'd probably consider treating it
differently... maybe *always* having a scale line on each PB that the user
can manipulate but not move to another PB; possibly having these scaling
lines in an array of their own or otherwise defined apart from the arrays of
"regular" lines for each PB.

From: David on
OK -- Trying to keep this post simple, but I have a number of different
scales that can be assigned. In all cases these scales will be based on the
1st line in the PBox UNLESS each line is allowed to "float" -- that is use
each lines own scale.

======== Re: Your Questions =============
1) The first line in any PBox determines the scale. So movement of
1st line to third PBox would cause the 1st line scale to be used in
that PBox.

2) 1st line to second PBox presents a little more of an issue. Based on
my criteria, I would say that it would now scale to the 1st line
already
in the 2nd PBox.

3) The second line in the 1st PBox would now be used to scale the 1st PBox,
since the 1st line is no longer in the 1st PBox.



"Bob Butler" <noway(a)nospam.ever> wrote in message
news:OsUjIk4qKHA.4636(a)TK2MSFTNGP06.phx.gbl...
>
> "David" <NoWhere(a)earthlink.net> wrote in message
> news:OSXC1c4qKHA.5936(a)TK2MSFTNGP04.phx.gbl...
>> Mr. Butler:
>> Thanks for taking a look see.
>>
>> First your correct on this declare
>>
>>>> Type TPBox(PBoxNumber)
>>>
>>> You can't declare a type as an array like that so that isn't valid VB
>>> code
>>>
>>
>> My error, was trying to cut corners and show that the structure was an
>> array.
>>
>> ======================
>>
>> There is a lot of code (many procedures) so difficult to post.
>> ========================
>>
>> Bottom line is I'm trying to track different objects (e.g. lines) which
>> can be drawn and moved -- at user selection -- between different
>> pictureboxes.
>>
>> Since the first line drawn in each picturebox determines the scale for
>> the picturebox, the movement of that line to a "new" picturebox would
>> corrupt any other lines in the "old" picturebox.
>>
>> Looking for a simple yet effective method to do this.
>
> OK, setting aside how to do it for a moment... I as a user draw a few
> lines on the first PB, a couple on the second, and none on the third...
>
> Now I "move" the first line from the first PB to the second (which already
> has some)
> -- what happens on the first PB? does the second line drawn now become
> the basis for scaling? Does the first line remain since it set the scale?
> -- what happens on the second PB? does the line being moved get re-scaled
> to fit the scale already set or does it become the new "first" line and
> cause whatever is there already to be rescaled?
>
> If I move the line to the third PB instead (which has nothing already) I'd
> assume it would become the first line there but the question of what
> happens on the first PB still holds?
>
> I'm unclear how one line defines scale for the others but it one line is
> different than all others in a set then I'd probably consider treating it
> differently... maybe *always* having a scale line on each PB that the user
> can manipulate but not move to another PB; possibly having these scaling
> lines in an array of their own or otherwise defined apart from the arrays
> of "regular" lines for each PB.
>


 |  Next  |  Last
Pages: 1 2 3
Prev: Differences between VB5 and VB6
Next: Creating ADD ONS