| |

VerySource

 Forgot password?
 Register
Search
View: 1524|Reply: 3

I don't know if it can be achieved in StringGrid. I have tried many times and still no results. Please look at the mast

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-16 17:00:01
| Show all posts |Read mode
The number of rows in the StringGrid is
StringGrid-> RowCount + = 1;
Dynamically added. In the process of adding, I want to focus on the last added line, roughly like the one in ListView:
ListView1-> Items-> Item [ListView1-> Items-> Count-1]-> MakeVisible (true);
That is, the data of the last row has the focus of StringGrid, and the vertical scroll bar of StringGrid is at the bottom of the table.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Unknown

Post time: 2020-1-21 13:18:02
| Show all posts
void __fastcall TForm1 :: Button1Click (TObject * Sender)
{
  StringGrid1-> RowCount = StringGrid1-> RowCount + 1;
  StringGrid1-> Row = StringGrid1-> RowCount-1;
}
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-21 13:45:01
| Show all posts
StringGrid1.RowCount: = StringGrid1.RowCount + 1;
  StringGrid1.Row: = StringGrid1.RowCount-1;
  StringGrid1.Col: = 1;
  StringGrid1.SetFocus;
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-24 12:15:01
| Show all posts
agree
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list