PopupPositionプロパティを使用すると、ポップアップウィンドウとして表示するフォームの表示位置を指定できます。
 |
- 表示位置を指定できるのは、ポップアップウィンドウにフォームを設定している場合のみです。ColorDialogなどのWindowsフォームコンポーネントをポップアップウィンドウに使用する場合は表示位置を指定できません。
|
PopupPositionの値 |
説明 |
NotSet |
表示されるウィンドウのStartPositionプロパティに値が適用されます。 |
CenterScreen |
画面の中央にウィンドウを表示します。 |
CenterParentForm |
アクティブなMultiRowコントロールが配置されている親フォームの中央にウィンドウを表示します。 |
CenterMultiRow |
アクティブなMultiRowコントロールの中央にウィンドウを表示します。 |
WindowsDefaultLocation |
Windowsによって自動的に決定された位置にウィンドウを表示します。 |
Manual |
PopupLocationプロパティで指定した位置にウィンドウを表示します。 |
AroundCell |
アクティブセルの周辺にウィンドウを表示します。基本的にはウィンドウはアクティブセルの右下に表示しますが、表示領域がない場合は別の位置に表示します。 |
次のコードではアクティブなセルの周辺にエディタ画面を表示します。
Imports GrapeCity.Win.MultiRow
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {New PopupCell()})
Dim PopupCell1 As PopupCell = DirectCast(GcMultiRow1.Rows(0).Cells(0), PopupCell)
PopupCell1.Popup = New Form2()
PopupCell1.PopupPosition = DialogPopupPosition.AroundCell
using GrapeCity.Win.MultiRow;
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { new PopupCell() });
PopupCell popupCell1 = gcMultiRow1.Rows[0].Cells[0] as PopupCell;
popupCell1.Popup = new Form2();
popupCell1.PopupPosition = DialogPopupPosition.AroundCell;
エディタ画面を指定した位置に表示するには、PopupPositionプロパティにManualを設定して、表示位置の座標をPopupLocationプロパティで指定します。
Imports GrapeCity.Win.MultiRow
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {New PopupCell()})
Dim PopupCell1 As PopupCell = DirectCast(GcMultiRow1.Rows(0).Cells(0), PopupCell)
PopupCell1.Popup = New Form2()
PopupCell1.PopupPosition = DialogPopupPosition.Manual
PopupCell1.PopupLocation = New Point(200, 200)
using GrapeCity.Win.MultiRow;
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { new PopupCell() });
PopupCell popupCell1 = gcMultiRow1.Rows[0].Cells[0] as PopupCell;
popupCell1.Popup = new Form2();
popupCell1.PopupPosition = DialogPopupPosition.Manual;
popupCell1.PopupLocation = new Point(200, 200);