語言

UrlBuilder.BuildUrl 方法

定義

建立一個使用者介面來建立或選擇網址。

多載

名稱 Description
BuildUrl(IComponent, Control, String, String, String)

建立一個使用者介面來建立或選擇網址。

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

建立一個使用者介面,使用指定的 UrlBuilderOptions 物件來建立或選擇 URL。

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

建立一個使用者介面,使用指定的 UrlBuilderOptions 物件來建立或選擇 URL。

BuildUrl(IComponent, Control, String, String, String)

建立一個使用者介面來建立或選擇網址。

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter);
public static string BuildUrl(System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String) As String

參數

component
IComponent

IComponent該網站將用於存取設計時服務。

owner
Control

它們 Control 被用作選擇視窗的父視窗。

initialUrl
String

初始網址會在選擇視窗中顯示。

caption
String

Picker 視窗的說明。

filter
String

用來選擇性地過濾選取視窗中顯示的檔案的篩選字串。

傳回

網址是從介面回傳的。

範例

以下程式碼範例展示了如何在設計時使用 BuildUrl 該方法從選單指令啟動 URL 建構器。

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另請參閱

適用於

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

建立一個使用者介面,使用指定的 UrlBuilderOptions 物件來建立或選擇 URL。

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl(System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

參數

component
IComponent

IComponent該網站將用於存取設計時服務。

owner
Control

它們 Control 被用作選擇視窗的父視窗。

initialUrl
String

初始網址會在選擇視窗中顯示。

caption
String

Picker 視窗的說明。

filter
String

用來選擇性地過濾選取視窗中顯示的檔案的篩選字串。

options
UrlBuilderOptions

A UrlBuilderOptions 表示 URL 選擇選項。

傳回

網址是從介面回傳的。

範例

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另請參閱

適用於

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

建立一個使用者介面,使用指定的 UrlBuilderOptions 物件來建立或選擇 URL。

public:
 static System::String ^ BuildUrl(IServiceProvider ^ serviceProvider, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl(IServiceProvider serviceProvider, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : IServiceProvider * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (serviceProvider As IServiceProvider, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

參數

serviceProvider
IServiceProvider

IServiceProvider用於存取設計時服務。

owner
Control

它們 Control 被用作選擇視窗的父視窗。

initialUrl
String

初始網址會在選擇視窗中顯示。

caption
String

Picker 視窗的說明。

filter
String

用來選擇性地過濾選取視窗中顯示的檔案的篩選字串。

options
UrlBuilderOptions

A UrlBuilderOptions 表示 URL 選擇選項。

傳回

網址是從介面回傳的。

備註

介面 IServiceProvider 用於取得 IDesignerHost 設計主機的實作。

另請參閱

適用於