Page.Layout() 메서드 자체로는 충분하지 않습니다. 나는이 작업을 수행하는 것이 아니라 8시간 이후까지 내 대답을 게시 할 수있는 방법을 발견 WBSTreeView.sln 샘플 프로젝트 (VB.Net)에서
는 :
다른 레이아웃 유형을 통해보고 가능 -x 아래에 사용 된 enums. Compact -> DownRight는 우리가 만드는 대부분의 흐름에서 더 좋았습니다.
가 C 번호로 번역 :
// auto-layout, Compact Tree -> Down then Right
var layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLOPlaceStyle);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visPLOPlaceCompactDownRight);
layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLORouteStyle);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visLORouteFlowchartNS);
//// to change page orientation
//layoutCell = this._page.PageSheet.get_CellsSRC(
// (short)VisSectionIndices.visSectionObject,
// (short)VisRowIndices.visRowPrintProperties,
// (short)VisCellIndices.visPrintPropertiesPageOrientation);
//layoutCell.set_Result(
// VisUnitCodes.visPageUnits,
// (short)VisCellVals.visPPOLandscape);
// curved connector lines
layoutCell = this._page.PageSheet.get_CellsSRC(
(short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowPageLayout,
(short)VisCellIndices.visPLOLineRouteExt);
layoutCell.set_Result(
VisUnitCodes.visPageUnits,
(short)VisCellVals.visLORouteExtNURBS);
// perform the layout
this._page.Layout();
// optionally resize the page to fit the space taken by its shapes
this._page.ResizeToFitContents();
//
변경 커넥터 라인 색상 당신은 색상에 대한 공식이 작동하는 방법에 익숙하지 않은 경우
을,이 또한 매우 복잡 할 수 있습니다. By default int를 문자열로 지정하여 미리 정의 된 색상을 얻을 수는 있지만 이러한 색상이 무엇인지 알아낼 수있는 쉬운 방법이 없기 때문에이 방법은별로 도움이되지 않습니다. (Page.Colors 컬렉션이 있지만 각 RGB 값을 검사하여 색상 값을 알아 내야합니다.)
대신 공식에 고유 한 RGB 값을 사용할 수 있습니다.
private void SetConnectorLineColor(Shape connector, string colorFormula)
{
var cell = connector.get_Cells("LineColor");
cell.Formula = colorFormula;
}
internal static class AnswerColorFormula
{
public static string Green = "RGB(0,200,0)";
public static string Orange = "RGB(255,100,0)";
public static string Yellow = "RGB(255,200,0)";
public static string Red = "RGB(255,5,5)";
}