SSTab, Command buttons, and resizing problem 
Author Message
 SSTab, Command buttons, and resizing problem

I'm using the sstab control with separate command buttons on each tab.
Everything was fine until I added some code to center the command buttons
when the window was resized. Once I added this code the command button on
the second tab started showing up on the first tab as well. It shows up on
both. If anyone is familiar with this behaviour and how to solve it, please
help.

Here's a sample of the resize code, command1 is in the 0th tab, command2 is
in the 1st tab. When the resize code is added, command2 shows up in the 0th
and the 1st tab.

Private Sub Form_Resize()
  Command1.Left = SSTab1.Width / 2
  Command2.Left = SSTab1.Width / 2 - Command1.Width
End Sub

Please email.

Thanks,

John Holmes



Tue, 30 Jan 2001 03:00:00 GMT  
 SSTab, Command buttons, and resizing problem
John,

    This is because of the way that the SSTab control hides it's Child
Controls that don't belong to the current Tab. It does not make them NOT
Visible as you would expect (or as I expected). Instead it changes their
Left property to a large negative value, thus storing them off screen. If
you change the Left property of these "invisible" controls, you actually
change this negative value, and either end up showing the control or showing
it in the wrong place when you select it's Tab again.

    As a Professional Programmer, I found it a lot more cost effective to
buy an inexpensive 3rd Party control to do this for me ( FastForm available
at http://www.bigfoot.com/~ctsoftware ) than to spend the time coding it
myself. I had other re-sizing problems as well, and this control fixed
everything without me having to do any coding at all. If your doing this
just for fun - stick with it - it will give you good experience.

Regards
    Colin.

Quote:

>I'm using the sstab control with separate command buttons on each tab.
>Everything was fine until I added some code to center the command buttons
>when the window was resized. Once I added this code the command button on
>the second tab started showing up on the first tab as well. It shows up on
>both. If anyone is familiar with this behaviour and how to solve it, please
>help.

>Here's a sample of the resize code, command1 is in the 0th tab, command2 is
>in the 1st tab. When the resize code is added, command2 shows up in the 0th
>and the 1st tab.

>Private Sub Form_Resize()
>  Command1.Left = SSTab1.Width / 2
>  Command2.Left = SSTab1.Width / 2 - Command1.Width
>End Sub

>Please email.

>Thanks,

>John Holmes




Tue, 30 Jan 2001 03:00:00 GMT  
 SSTab, Command buttons, and resizing problem
I am a big fan of doing what works for you. But in addition, I'm also a
big fan of using ZERO 3rd party controls, or at least as few as
possible.

When I use a tab control (which is often), I use the one in the MS
Common Controls. Moreover, I use the VB Application wizard to create an
"Options Dialog" form. If you notice, all the controls for each tab are
placed on a picture box as the container. When you resize your form, you
could set the width and height of these picture boxes to a percentage of
the screen.height and screen.width and then move the controls that are
ON these picture boxes IN RELATION TO THE PICTURE BOX THEY'RE ON.

Sure, a 3rd party control could probably do this faster or write the
code for you, but the last thing you want to do is introduce 3rd party
ActiveX controls to help you with a lot of things that can indeed be
done WITHOUT these controls. Before you know it you could be trying to
distribute and register 5 or 6 third party controls.

Quote:
-----Original Message-----

Posted At: Friday, August 14, 1998 8:49 AM
Posted To: enterprise
Conversation: SSTab, Command buttons, and resizing problem
Subject: Re: SSTab, Command buttons, and resizing problem

John,

    This is because of the way that the SSTab control hides it's Child
Controls that don't belong to the current Tab. It does not make them NOT
Visible as you would expect (or as I expected). Instead it changes their
Left property to a large negative value, thus storing them off screen.
If
you change the Left property of these "invisible" controls, you actually
change this negative value, and either end up showing the control or
showing
it in the wrong place when you select it's Tab again.

    As a Professional Programmer, I found it a lot more cost effective
to
buy an inexpensive 3rd Party control to do this for me ( FastForm
available
at http://www.bigfoot.com/~ctsoftware ) than to spend the time coding it
myself. I had other re-sizing problems as well, and this control fixed
everything without me having to do any coding at all. If your doing this
just for fun - stick with it - it will give you good experience.

Regards
    Colin.


>I'm using the sstab control with separate command buttons on each tab.
>Everything was fine until I added some code to center the command
buttons
>when the window was resized. Once I added this code the command button
on
>the second tab started showing up on the first tab as well. It shows up
on
>both. If anyone is familiar with this behaviour and how to solve it,
please
>help.

>Here's a sample of the resize code, command1 is in the 0th tab,
command2 is
>in the 1st tab. When the resize code is added, command2 shows up in the
0th
>and the 1st tab.

>Private Sub Form_Resize()
>  Command1.Left = SSTab1.Width / 2
>  Command2.Left = SSTab1.Width / 2 - Command1.Width
>End Sub

>Please email.

>Thanks,

>John Holmes




Wed, 31 Jan 2001 03:00:00 GMT  
 SSTab, Command buttons, and resizing problem
Russ,

    Your either a very fast coder, or you are charging too little for your
time. It cost me the equivalent of 20 minutes of my time for the control. It
is automatically included and registered in the distribution setup, so that
was not an issue, apart from maybe a bit of disk space. I don't see the
point in re-inventing the wheel, and starting with a square one ;-)

Regards
    Molly


Quote:
>I am a big fan of doing what works for you. But in addition, I'm also a
>big fan of using ZERO 3rd party controls, or at least as few as
>possible.

>When I use a tab control (which is often), I use the one in the MS
>Common Controls. Moreover, I use the VB Application wizard to create an
>"Options Dialog" form. If you notice, all the controls for each tab are
>placed on a picture box as the container. When you resize your form, you
>could set the width and height of these picture boxes to a percentage of
>the screen.height and screen.width and then move the controls that are
>ON these picture boxes IN RELATION TO THE PICTURE BOX THEY'RE ON.

>Sure, a 3rd party control could probably do this faster or write the
>code for you, but the last thing you want to do is introduce 3rd party
>ActiveX controls to help you with a lot of things that can indeed be
>done WITHOUT these controls. Before you know it you could be trying to
>distribute and register 5 or 6 third party controls.



Thu, 01 Feb 2001 03:00:00 GMT  
 SSTab, Command buttons, and resizing problem
You don't need a 3rd party activeX control to promote easy/fast coding
or code reusability. And if you use one, you're depending on that 3rd
party activeX control's reliability (hoping it will be bug-free and easy
to distribute and maintain newer versions).

The one you use may very well be a great 3rd party control but I
maintain that I'd rather write the code for what needs to be done and
reuse my own stuff than trust anyone else's.

Quote:
-----Original Message-----

Posted At: Sunday, August 16, 1998 12:30 AM
Posted To: enterprise
Conversation: SSTab, Command buttons, and resizing problem
Subject: Re: SSTab, Command buttons, and resizing problem

Russ,

    Your either a very fast coder, or you are charging too little for
your
time. It cost me the equivalent of 20 minutes of my time for the
control. It
is automatically included and registered in the distribution setup, so
that
was not an issue, apart from maybe a bit of disk space. I don't see the
point in re-inventing the wheel, and starting with a square one ;-)

Regards
    Molly



>I am a big fan of doing what works for you. But in addition, I'm also a
>big fan of using ZERO 3rd party controls, or at least as few as
>possible.

>When I use a tab control (which is often), I use the one in the MS
>Common Controls. Moreover, I use the VB Application wizard to create an
>"Options Dialog" form. If you notice, all the controls for each tab are
>placed on a picture box as the container. When you resize your form,
you
>could set the width and height of these picture boxes to a percentage
of
>the screen.height and screen.width and then move the controls that are
>ON these picture boxes IN RELATION TO THE PICTURE BOX THEY'RE ON.

>Sure, a 3rd party control could probably do this faster or write the
>code for you, but the last thing you want to do is introduce 3rd party
>ActiveX controls to help you with a lot of things that can indeed be
>done WITHOUT these controls. Before you know it you could be trying to
>distribute and register 5 or 6 third party controls.



Fri, 02 Feb 2001 03:00:00 GMT  
 SSTab, Command buttons, and resizing problem
John,

I had huge problems resizing controls on an SSTab1 form.  Not quite the
same.  For me I had list boxes which suddenly became enormous, empty and
wouldn't go away.

The only solution I could find was to only size the controls for the
currently displayed tab.  For example:

Private Sub Form_Resize()
  Select Case SSTab1.Tab
    Case 1
      Command1.Left = SSTab1.Width / 2
      Command2.Left = SSTab1.Width / 2 - Command1.Width
    Case 2
      Command3.Left = SSTab1.Width / 2
      Command4.Left = SSTab1.Width / 2 - Command3.Width
  End Select
End Sub

Then in the "Click" event for the SSTAB1 control, just call the Resize
event.  Eg:

Private Sub SStab1_Click()
  Form_Resize
End Sub

(Actually, that may be wrong.  I think there's a "TabClick" or "TabChange"
type event which should include that.)

I have to say, I think automatic resizing of windows would be a great
addition to a future version of VB.  Say if you had a property for a form
"AutoResize".  Many forms would take hours to resize and even then you have
to compromise a bit.  I've heard of a system (I think it was on the
amiga..?) where you could have "weights" for each control.  That way you
could set up simple ratios and not have to worry any more.  And I think JAVA
(I might be wrong here) does all the resizing without that at all.  Too easy
with VB to just leave the resize event out.

Sorry, wandered a bit off topic.  Hope that helps a bit anyway,

John



Sun, 04 Feb 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. saving data's in sstabs in one command button

2. sstab-resize-problem

3. sstab control - resizing during runtime problem

4. Problem With SSTAB-Control if resize

5. Problem With SSTAB-Control if resize

6. resizing a bitmap in a command button

7. toolbar problem/resize buttons

8. SSTab and Resize Help Please

9. SSTab control and resizing a form

10. Pls Help !!! Resize SSTab - VB 6

11. resizing forms containing the sstab control

12. No Resizing SSTab-Contained Controls from a UserControl

 

 
Powered by phpBB® Forum Software