Share via


GridExtensions.Add 方法

定義

多載

Add(Grid, IView, Int32, Int32)

IView將 加入至Grid位於指定之數據行和數據列的 ,其數據列範圍為 1,而數據行範圍為 1。

Add(Grid, IView, Int32, Int32, Int32, Int32)
已淘汰.

IView將加入指定Grid之資料列和資料列範圍的 。

Add(Grid, IView, Int32, Int32)

IView將 加入至Grid位於指定之數據行和數據列的 ,其數據列範圍為 1,而數據行範圍為 1。

public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int column = 0, int row = 0);
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, Optional column As Integer = 0, Optional row As Integer = 0)

參數

grid
Grid

Grid將加入的 IView

view
IView

要加入的 IView

column
Int32

要在其中放置的數據 IView行。

row
Int32

要在其中放置的數據 IView列。

例外狀況

view 為 null 時擲回。

當或 column 小於0時row擲回。

備註

Grid如果 沒有足夠的數據列/數據行來包含指定的位置,則會新增它們。

適用於

Add(Grid, IView, Int32, Int32, Int32, Int32)

警告

This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.

IView將加入指定Grid之資料列和資料列範圍的 。

public:
[System::Runtime::CompilerServices::Extension]
 static void Add(Microsoft::Maui::Controls::Grid ^ grid, Microsoft::Maui::IView ^ view, int left, int right, int top, int bottom);
[System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")]
public static void Add (this Microsoft.Maui.Controls.Grid grid, Microsoft.Maui.IView view, int left, int right, int top, int bottom);
[<System.Obsolete("This method is obsolete. Please use AddWithSpan(this Grid, IView, int, int, int, int) instead.")>]
static member Add : Microsoft.Maui.Controls.Grid * Microsoft.Maui.IView * int * int * int * int -> unit
<Extension()>
Public Sub Add (grid As Grid, view As IView, left As Integer, right As Integer, top As Integer, bottom As Integer)

參數

grid
Grid

Grid將加入的 IView

view
IView

要加入的 IView

left
Int32

資料行範圍的左邊緣。 必須大於或等於 0。

right
Int32

資料行範圍的右邊緣。 必須大於左邊緣。 IView不會佔用此數據行,而是會在它之前停止。

top
Int32

資料列範圍的上邊緣。 必須大於或等於 0。

bottom
Int32

資料列範圍的下邊緣。 必須大於上邊緣。 IView不會佔用此數據列,而是會在它之前停止。

屬性

例外狀況

view 為 null 時擲回。

lefttop 小於 0、 bottom 小於或等於 top時擲回 ,或 right 小於或等於 left

備註

Grid如果 沒有足夠的數據列/數據行來包含指定的範圍,則會新增它們。

適用於