Scheduler for WinForms
BeforeGroupHeaderFormat イベント (C1Schedule)
使用例 

C1.Win.C1Schedule.4.5.2 アセンブリ > C1.Win.C1Schedule 名前空間 > C1Schedule クラス : BeforeGroupHeaderFormat イベント
グループヘッダーが書式設定される前に発生します。
シンタックス
'宣言
 
Public Event BeforeGroupHeaderFormat As System.EventHandler(Of BeforeGroupHeaderFormatEventArgs)
public event System.EventHandler<BeforeGroupHeaderFormatEventArgs> BeforeGroupHeaderFormat
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、BeforeGroupHeaderFormatEventArgs 型の引数を受け取りました。次の BeforeGroupHeaderFormatEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
現在書式設定されている ScheduleGroupItemオブジェクトを取得します。  
グループヘッダータブの外観を決定する GroupTabStyle値を取得または設定します。  
グループヘッダーに表示される HTML テキストを取得または設定します。  
グループヘッダーの表示に使用される Styleオブジェクトを取得または設定します。  
グループヘッダータブの外観を決定する System.Boolean値を取得または設定します。このプロパティ値が true の場合、C1Schedule は MS Outlook 2010 に類似したグループヘッダーを表示します。このプロパティ値が false の場合、C1Schedule は矩形のグループヘッダーを表示します。  
解説
デフォルトのグループヘッダーの外観を変更するには、このイベントを使用します。グループヘッダーのスタイル、タブの形状、または表示されるコンテンツを変更できます。
使用例
このサンプルは、 BeforeGroupHeaderFormatEventArgsプロパティに応じてグループヘッダーの外観を変更する方法を示します。
private void c1Schedule1_BeforeGroupHeaderFormat(object sender, 
  BeforeGroupHeaderFormatEventArgs e)
{
  Contact owner = e.Group.Owner as Contact;
  if (owner != null)
  {
    TestSchedule.NwindDataSet.EmployeesRow row = this.nwindDataSet.Employees.FindByEmployeeID((int)owner.Key[0]);
    if (row != null)
    {
      string imageName = "photo" + row.EmployeeID + ".bmp";
      if (File.Exists(imageName))
      {
        // ファイルからの画像のみを使用します
        // C1Schedule はインターネット (http://..)、アプリケーションリソース (res://..)
        // およびローカルファイルシステム (file:///...)からの画像のみを受け入れることにご注意ください
        e.Html = row.FirstName + " " + row.LastName + "<br><img src=file:///" + imageName + "/>";
      }
    }
  }
  
  if (e.Style.Hot != null)
  {
    // Hot スタイルは ScheduleGroupItem が選択されたときにグループヘッダーに適用されます
    e.Style.Hot.BackColor2 = e.Style.Hot.BorderColor = Color.DarkSlateGray;
    e.Style.Hot.ForeColor = Color.WhiteSmoke;
  }
  
  // 矩形タブを使用します
  e.TriangleTab = false;
}
参照