このトピックでは、タイムスケール ボタンをクリックしたときに表示される階層の設定、単位の指定、およびタイムスケールの書式設定をプログラム的に実行する方法を示します。
Visual Basic コードの書き方
| Visual Basic | 
                         
                            コードのコピー
                         
                     | 
                
|---|---|
| Private Sub btnTimescale_Click(sender As Object, e As EventArgs) Dim st As ScaleTier = ganttView.Timescale.TopTier st.Units = TimescaleUnits.ThirdsOfMonths st.Format = "sd" st.Visible = True End Sub  | 
                |
C#コードの書き方
| C# | 
                         
                            コードのコピー
                         
                     | 
                
|---|---|
| private void btnTimescale_Click(object sender, EventArgs e) { ScaleTier st = ganttView.Timescale.TopTier; st.Units = TimescaleUnits.ThirdsOfMonths; st.Format = "sd"; st.Visible = true; }  | 
                |