Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Scrollbar help on String Grid and on TForm



Permlink Replies: 8 - Last Post: Mar 1, 2018 10:39 AM Last Post By: Gary Olson Threads: [ Previous | Next ]
Gary Olson

Posts: 29
Registered: 5/2/08
Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 10:34 AM
Hi,

I have a extra high string grid inside a form. the form size is about 800x1000 but it barely fits in the height department. I see a horizontal scrollbar on the string grid when I run
the program but I would like to shrink the form both vertically and horizontally so that I can use both a vertical and horizontal scrollbar,

Is this possible to get a a vertical scrollbar.

I also tried to use the scrollbox on the form but am not seeing those scrollbars either.

on ScrollBox I checked AutoScroll true
Inside VertscrollBar Properties

I unchecked Parent Color False and Checked True.
Tried changing color

Nothing i tried seems to have a efect on the form scrollbars.

Form and Stringgrid. scrollbars. I do have a horizontal Scrollbar directly on the string grid.

Thanks

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 10:53 AM   in response to: Gary Olson in response to: Gary Olson
Gary Olson wrote:

I have a extra high string grid inside a form. the form size is
about 800x1000 but it barely fits in the height department. I see a
horizontal scrollbar on the string grid when I run the program but I
would like to shrink the form both vertically and horizontally so
that I can use both a vertical and horizontal scrollbar,

Is this possible to get a a vertical scrollbar.

So, you want scrollbars on the Form itself, and not just on the
StringGrid? It is generally not good to make a Form have scrollbars,
the controls inside the Form should have their own scrollbars as
needed. A properly aligned StringGrid with scrollbars enabled should
be sufficient to provide access to the StringGrid content without
requiring the Form itself to be scrollable as well. The dimensions of
the StringGrid should not exceed the dimensions of the Form.

I also tried to use the scrollbox on the form but am not seeing those
scrollbars either.

on ScrollBox I checked AutoScroll true
Inside VertscrollBar Properties

Nothing i tried seems to have a efect on the form scrollbars.

Of course using a ScrollBox would not affect the Form's scrolling,
since the ScrollBox has its own scroll area and scrollbars.

I do have a horizontal Scrollbar directly on the string grid.

So why do you need one on the Form, too?

--
Remy Lebeau (TeamB)
Gary Olson

Posts: 29
Registered: 5/2/08
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 11:52 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy Lebeau,

I created an Example Project can you look at it. I do not see away to attach it here.

Thank You,
Gary

Remy Lebeau (TeamB) wrote:
Gary Olson wrote:

I have a extra high string grid inside a form. the form size is
about 800x1000 but it barely fits in the height department. I see a
horizontal scrollbar on the string grid when I run the program but I
would like to shrink the form both vertically and horizontally so
that I can use both a vertical and horizontal scrollbar,

Is this possible to get a a vertical scrollbar.

So, you want scrollbars on the Form itself, and not just on the
StringGrid? It is generally not good to make a Form have scrollbars,
the controls inside the Form should have their own scrollbars as
needed. A properly aligned StringGrid with scrollbars enabled should
be sufficient to provide access to the StringGrid content without
requiring the Form itself to be scrollable as well. The dimensions of
the StringGrid should not exceed the dimensions of the Form.

I also tried to use the scrollbox on the form but am not seeing those
scrollbars either.

on ScrollBox I checked AutoScroll true
Inside VertscrollBar Properties

Nothing i tried seems to have a efect on the form scrollbars.

Of course using a ScrollBox would not affect the Form's scrolling,
since the ScrollBox has its own scroll area and scrollbars.

I do have a horizontal Scrollbar directly on the string grid.

So why do you need one on the Form, too?

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 2:03 PM   in response to: Gary Olson in response to: Gary Olson
Gary Olson wrote:

I created an Example Project can you look at it. I do not see away
to attach it here.

Use the Attachments forum for that.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 2:05 PM   in response to: Gary Olson in response to: Gary Olson
Gary Olson wrote:

I created an Example Project can you look at it.

What you showed does not clarify what you are trying to accomplish.
Please be more specific. What EXACTLY do you WANT the UI to look like,
and what is the ACTUAL PROBLEM you are having with acheiving that?

--
Remy Lebeau (TeamB)
Gary Olson

Posts: 29
Registered: 5/2/08
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2018 11:58 AM   in response to: Gary Olson in response to: Gary Olson
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 929
ClientWidth = 942
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object StringGrid1: TStringGrid
Left = 100
Top = 30
Width = 785
Height = 779
ColCount = 9
DefaultColWidth = 60
DefaultRowHeight = 18
FixedCols = 0
RowCount = 40
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
ColWidths = (
60
124
97
72
60
95
60
95
91)
RowHeights = (
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18)
end
end
Gary Olson

Posts: 29
Registered: 5/2/08
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2018 4:35 AM   in response to: Gary Olson in response to: Gary Olson
I would like to send a picture (png file). But can not see how to attach.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 26, 2018 8:57 AM   in response to: Gary Olson in response to: Gary Olson
Gary Olson wrote:

I would like to send a picture (png file). But can not see
how to attach.

Use the Attachments forum.

--
Remy Lebeau (TeamB)
Gary Olson

Posts: 29
Registered: 5/2/08
Re: Scrollbar help on String Grid and on TForm
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 1, 2018 10:39 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Gary Olson wrote:

I would like to send a picture (png file). But can not see
how to attach.

Use the Attachments forum.

--
Remy Lebeau (TeamB)

I did make an attachment if you want to see.

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02