作成日: 2014/09/26 最終更新日: 2014/09/26
文書種別
技術情報
詳細
実行時にプロパティダイアログを表示する為の機能として、C1Chart.ShowPropertiesメソッドが用意されております。
例えばグラフの右クリック時に表示されるよう設定するには、下記のサンプルコードのようにMouseClickイベント内でMouseButtonsを判断します。
また、引数に任意のPropertyPageFlagsを指定すると、ダイアログ上に特定のプロパティのみを表示できます。
◆サンプルコード
[VB]
[C#]
例えばグラフの右クリック時に表示されるよう設定するには、下記のサンプルコードのようにMouseClickイベント内でMouseButtonsを判断します。
また、引数に任意のPropertyPageFlagsを指定すると、ダイアログ上に特定のプロパティのみを表示できます。
◆サンプルコード
[VB]
Private Sub C1Chart1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1Chart1.MouseClick
If e.Button = Windows.Forms.MouseButtons.Right Then
'デフォルトのプロパティダイアログを表示します
C1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.All)
'X軸とY軸のスケールのみを含むプロパティダイアログを表示します
'C1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.AxisXScale Or C1.Win.C1Chart.PropertyPageFlags.AxisYScale)
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
'デフォルトのプロパティダイアログを表示します
C1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.All)
'X軸とY軸のスケールのみを含むプロパティダイアログを表示します
'C1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.AxisXScale Or C1.Win.C1Chart.PropertyPageFlags.AxisYScale)
End If
[C#]
private void c1Chart1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
//デフォルトのプロパティダイアログを表示します
c1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.All);
//X軸とY軸のスケールのみを含むプロパティダイアログを表示します
//c1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.AxisXScale | C1.Win.C1Chart.PropertyPageFlags.AxisYScale);
}
}
{
if (e.Button == MouseButtons.Right)
{
//デフォルトのプロパティダイアログを表示します
c1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.All);
//X軸とY軸のスケールのみを含むプロパティダイアログを表示します
//c1Chart1.ShowProperties(C1.Win.C1Chart.PropertyPageFlags.AxisXScale | C1.Win.C1Chart.PropertyPageFlags.AxisYScale);
}
}
旧文書番号
69757