CurrencyManager.Refresh メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CurrencyManager.Refresh メソッドの意味・解説 

CurrencyManager.Refresh メソッド

データ バインド リスト強制的に再作成ます。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説
使用例使用例

配列作成し、それを TextBox コントロールバインドしてから、値を 1 つ変更するコード例次に示しますRefresh メソッド呼び出してTextBox コントロールによって表示される値を更新できます

Private Sub DemonstrateRefresh()
    ' Create an array with ten elements and bind to a TextBox.
    Dim myArray(9) As String
    Dim i As Integer
    For i = 0 To 9
        myArray(i) = "item " & i
    Next i
    textBox1.DataBindings.Add("Text", myArray, "")
    ' Change one value.
    myArray(0) = "New value"

    ' Uncomment the next line to refresh the CurrencyManager.
    ' RefreshGrid(myArray);

End Sub 'DemonstrateRefresh

Private Sub RefreshGrid(dataSource As
 Object)
    Dim myCurrencyManager As CurrencyManager
 = CType(Me.BindingContext(dataSource), CurrencyManager)
    myCurrencyManager.Refresh()
End Sub 'RefreshGrid
private void DemonstrateRefresh(){
    // Create an array with ten elements and bind to a TextBox.
    string[] myArray= new string[10];
    for(int i = 0; i <10; i++){
       myArray[i] = "item " + i;
    }
    textBox1.DataBindings.Add ("Text",myArray,"");
    // Change one value.
    myArray[0]= "New value";

    // Uncomment the next line to refresh the CurrencyManager.
    // RefreshGrid(myArray);
 }
 private void RefreshGrid(object dataSource){
    CurrencyManager myCurrencyManager = (CurrencyManager)this.BindingContext[dataSource];
    myCurrencyManager.Refresh();
 }
      
void DemonstrateRefresh()
{
   
   // Create an array with ten elements and bind to a TextBox.
   array<String^>^myArray = gcnew array<String^>(10);
   for ( int i = 0; i < 10; i++ )
   {
      myArray[ i ] = String::Format( "item {0}", i );

   }
   textBox1->DataBindings->Add( "Text", myArray, "" );
   
   // Change one value.
   myArray[ 0 ] = "New value";
   
   // Uncomment the next line to refresh the CurrencyManager.
   // RefreshGrid(myArray);
}

void RefreshGrid( Object^ dataSource )
{
   CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(this->BindingContext[
 dataSource ]);
   myCurrencyManager->Refresh();
}

private void DemonstrateRefresh()
{
    // Create an array with ten elements and bind to a TextBox.
    String myArray[] = new String[10];
    for (int i = 0; i < 10; i++) {
        myArray[i] = "item " + i;
    }
    textBox1.get_DataBindings().Add("Text", myArray, "");
    // Change one value.
    myArray[0] = "New value";
} //DemonstrateRefresh

// Uncomment the next line to refresh the CurrencyManager.
// RefreshGrid(myArray);
private void RefreshGrid(Object dataSource)
{
    CurrencyManager myCurrencyManager = 
        (CurrencyManager)(this.get_BindingContext().
        get_Item(dataSource));
    myCurrencyManager.Refresh();
} //RefreshGrid
private function DemonstrateRefresh(){
    // Create an array with ten elements and bind to a TextBox.
    var myArray : String[] = new String[10];
    for(var i : int = 0;
 i <10; i++){
       myArray[i] = "item " + i;
    }
    textBox1.DataBindings.Add ("Text",myArray,"");
    // Change one value.
    myArray[0]= "New value";

    // Uncomment the next line to refresh the CurrencyManager.
    // RefreshGrid(myArray);
 }
 private function RefreshGrid(dataSource){
    var myCurrencyManager : CurrencyManager = CurrencyManager(this.BindingContext[dataSource]);
    myCurrencyManager.Refresh();
 }
      
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CurrencyManager.Refresh メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CurrencyManager.Refresh メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS