Tablebox() - 如何將焦點設定到特定行?您好,假設我有一個 Tablebox(),它有很多行(例如 1000 行)。在這種情況下,它會自動顯示垂直捲軸。 (這很好,因為有很多行)但是如何將焦點設為第 n=685 行呢?有具體的命令或方法嗎?這裡所說的焦點是指一個指令,該指令會自動將垂直滾動條捲動到第 n=685 行。 (這樣用戶就不必手動透過垂直滾動條向下滾動了)
謝謝,DJ
進階統計建模實驗設計大規模客製化Re: Tablebox() - 如何將焦點設置到特定行?好的,我想出了一個解決方案!這將在 tablebox() 中設置特定行的焦點。基本上,您只需要禁用與 tablebox() 關聯的標準滾動,然後將該 tablebox 包裝在 scrollbox() 中。大致是這樣完成的:
//r10 is a report of a data table called dt10
//wrap the report tablebox in a scrollbox
sb10 = Scroll Box( size( 700, 400 ), r10 );
//disable the scrolling of the report tablebox
r10[Table Box( 1 )] << set selectable rows();
r10[Table Box( 1 )] << set scrollable( 0, 0 );
//find max hor and vert pixel range of scrollbox sb10
sb10max = sb10 << get scroll extents;
//now reference the vertical component of sb10max
//make a buttonbox and you can find key rows in tablebox
//and find their ratio of where they occur as row indices to nrows(dt10)
//then multiply them by sb10max and this will force the
//tablebox to scroll by the action of the buttonbox! woo-hoo!
Re: Tablebox() - 如何將焦點設置到特定行?Table Box() 對像中不存在此類消息。我也希望它有這種能力
Re: Tablebox() - 如何將焦點設置到特定行?我可能會添加,在 Scrollbox() 中有一個 <