PowerTools InputMan for Windows Forms 8.0J
AddressOutput プロパティ (GcPostal)
使用例 

検索された住所の漢字情報が出力されるコントロールを取得または設定します。
構文
Public Property AddressOutput As Control
public Control AddressOutput {get; set;}

プロパティ値

漢字情報の出力先を示す System.Windows.Forms.Control 値。
使用例
次のサンプルコードは住所検索の条件を設定したGcPostalコントロールの作成方法の例です。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using GrapeCity.Win.Editors;

public void CustomizeGcPostal()
{
    // Creates an instance of a GcPostal control.
    GcPostal gcPostal1 = new GcPostal();
    TextBox textBox1 = new TextBox();
    TextBox textBox2 = new TextBox();
    TextBox textBox3 = new TextBox();
    TextBox textBox4 = new TextBox();
    DataGridView dataGridView1 = new DataGridView();

    // Sets the QueryMode property.
    // The input zipcode number will be converted to half width to display in the Fields.
    gcPostal1.ZipCodeCharType = ZipCodeCharType.HalfWidthDigit;

    // Sets the QueryMode property.
    // The input zipcode can't be use general zipcode or company zipcode to search.
    gcPostal1.QueryMode = ZipCodeQueryMode.Both;

    // Sets the GenerateCompanyAddressKana property.
    // The query result for the company data will contains the reading kana for the prefecture, city and town
    gcPostal1.GenerateCompanyAddressKana = true;

    // Sets the SplitAreaDetails property.
    // Split area information contained in the town as independent Area information
    gcPostal1.SplitAreaDetails = false;

    gcPostal1.TextChanged += delegate
    {
        // all searched result will be displayed in the DataGridView control.
        dataGridView1.DataSource = gcPostal1.Addresses;
    };

    // Sets the AddressOutput property.
    // The searched first address information will be output to Text property of textBox1 control.
    gcPostal1.AddressOutput = textBox1;

    // Sets the AddressKanaOutput property.
    // The searched first address kana information will be output to Text property of textBox2 control.
    gcPostal1.AddressKanaOutput = textBox2;

    // The searched first address information will be contained in PostalAddressOutputtingEventArgs.
    gcPostal1.AddressOutputting += delegate(object sender, PostalAddressOutputtingEventArgs e)
    {
        textBox3.Text = e.OutputAddress;
        textBox4.Text = e.OutputAddressKana;
    };
}
'  Please use the following namespace
'  Imports System.Windows.Forms
'  Imports GrapeCity.Win.Editors

' Creates an instance of a GcPostal control.
Dim gcPostal1 As New GcPostal()
Dim textBox1 As New TextBox()
Dim textBox2 As New TextBox()
Dim textBox3 As New TextBox()
Dim textBox4 As New TextBox()
Dim dataGridView1 As New DataGridView()

Public Sub CustomizeGcPostal()
    ' Sets the QueryMode property.
    ' The input zipcode number will be converted to half width to display in the Fields.
    gcPostal1.ZipCodeCharType = ZipCodeCharType.HalfWidthDigit

    ' Sets the QueryMode property.
    ' The input zipcode can't be use general zipcode or company zipcode to search.
    gcPostal1.QueryMode = ZipCodeQueryMode.Both

    ' Sets the GenerateCompanyAddressKana property.
    ' The query result for the company data will contains the reading kana for the prefecture, city and town
    gcPostal1.GenerateCompanyAddressKana = True

    ' Sets the SplitAreaDetails property.
    ' Split area information contained in the town as independent Area information
    gcPostal1.SplitAreaDetails = False

    ' Sets the AddressOutput property.
    ' The searched first address information will be output to Text property of textBox1 control.
    gcPostal1.AddressOutput = textBox1

    ' Sets the AddressKanaOutput property.
    ' The searched first address kana information will be output to Text property of textBox2 control.
    gcPostal1.AddressKanaOutput = textBox2

    AddHandler gcPostal1.TextChanged, AddressOf OnTextChanged

    AddHandler gcPostal1.AddressOutputting, AddressOf OnAddressOutputting
End Sub

Private Sub OnTextChanged(ByVal sender As Object, ByVal e As EventArgs)
    dataGridView1.DataSource = gcPostal1.Addresses
End Sub

Private Sub OnAddressOutputting(ByVal sender As Object, ByVal e As PostalAddressOutputtingEventArgs)
    textBox3.Text = e.OutputAddress
    textBox4.Text = e.OutputAddressKana
End Sub
参照

GcPostal クラス
GcPostal メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.