Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2001, 10:34 AM
Beardawg Beardawg is offline
Member
 
Join Date: Mar 2001
Posts: 75
Default Challenging StringGrid Question

Okay,
I am using the TMS AdvString Grid to represent a four-line scrollable display(long story). Regardless, I only want to scroll the middle to rows. (ie, retain a header and footer)... I designed my own buttons for the purpose of scrolling the two rows... I tried using the available hide and unhide to simulate scrolling. This does not work correctly because there is now way to obtain the index of hidden rows without checking each on and doing some "wasted" looping each time. Here's my code in the on_click event:

(By the way, the string grid and buttons are dynamic)

procedure TMainForm.DownButtonClick(Sender: TObject);
var
iRange, iHidden, iVisible, i: Integer;
begin
//MessageDlg('Amazing!!! You clicked the down button.', mtConfirmation, [mbOK], 0);
iRange := StrGridArray[PageControl1.ActivePageIndex].RowCount;
iVisible := StrGridArray[PageControl1.ActivePageIndex].VisibleRowCount;
iHidden := iRange - iVisible;
i := 0;
while StrGridArray[PageControl1.ActivePageIndex].IsHiddenRow(i) do
begin
i := i + 1;
end;
StrGridArray[PageControl1.ActivePageIndex].HideRow(i + 1);
StrGridArray[PageControl1.ActivePageIndex].UnHideRow(i + 2);
StrGridArray[PageControl1.ActivePageIndex].Repaint;
end;

Any ideas?
Reply With Quote
  #2  
Old 05-10-2001, 10:49 AM
Jigsaw Jigsaw is offline
Senior Member
 
Join Date: Mar 2001
Posts: 137
Default RE: Challenging StringGrid Question

May sound a bit silly, but wouldn't it be a lot less complicated to just permanently hide the first and last rows, and place an extra grid above and below the actual grid of one row high, the top one displaying the first line, and the bottom one the last line? You can give them a nice header and footer colour and all.
I do not know this component, so I don't know if this is easily do-able.

Jigsaw.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 03:23 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.