I have several StringGrid components in the same frame. All grids have the same headings. I would like to have the horizontal scrollbar of the frame show up automatically if the window is more narrow than the width of the StringGrid. The vertical scrollbar is showing up correctly.
The Frame containing the StringGrid components is set to Align: alClient. The StringGrid components are set to Align: alTop. Both the Frame and the Form have AutoScroll: true.
Here is the component hierarchy:
Form1
|- Frame21
|- StringGrid1
|- StringGrid2
This is what the form currently looks like (missing the horizontal scrollbar):
I don't want individual horizontal scroll bars in each StringGrid like this:
This doesn't work:
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
this->Frame21->HorzScrollBar->Visible = true;
this->HorzScrollBar->Visible = true;
}
Here is a related post that doesn't answer my question: