CurrencyManager.Refresh メソッド
アセンブリ: 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(); }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCurrencyManager.Refresh メソッドを検索する場合は、下記のリンクをクリックしてください。

- CurrencyManager.Refresh メソッドのページへのリンク