下面的示例代码把活动视图的布局保存到内存流中,然后从中恢复。 为了达到此目的,使用了BaseView.SaveLayoutToStream 和 BaseView.RestoreLayoutFromStream 方法。
C# | 复制代码 |
---|
System.IO.Stream str;
str = new System.IO.MemoryStream();
gridControl1.KeyboardFocusView.SaveLayoutToStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
gridControl1.KeyboardFocusView.RestoreLayoutFromStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
|
Visual Basic | 复制代码 |
---|
Dim str As System.IO.Stream
str = New System.IO.MemoryStream()
GridControl1.KeyboardFocusView.SaveLayoutToStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)
GridControl1.KeyboardFocusView.RestoreLayoutFromStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)
|