- Метод Form.Refresh (Access) Form.Refresh method (Access)
- Синтаксис Syntax
- Возвращаемое значение Return value
- Примечания Remarks
- Пример Example
- Поддержка и обратная связь Support and feedback
- How to reload or refresh Windows Form into original state?
- 4 Answers 4
- Refresh form windows forms
- Answered by:
- Question
- Answers
- All replies
- Web Browser. Refresh Method
- Definition
- Overloads
- Refresh()
- Examples
- Remarks
- Web Browser. Refresh Метод
- Определение
- Перегрузки
- Refresh()
- Примеры
- Комментарии
Метод Form.Refresh (Access) Form.Refresh method (Access)
Метод Refresh сразу же обновляет записи в базовом источнике записей для указанной формы или таблицы, чтобы отразить изменения данных, внесенные вами и другими пользователями в многопользовательской среде. The Refresh method immediately updates the records in the underlying record source for a specified form or datasheet to reflect changes made to the data by you and other users in a multiuser environment.
Синтаксис Syntax
выражение.Refresh expression.Refresh
выражение: переменная, представляющая объект Form. expression A variable that represents a Form object.
Возвращаемое значение Return value
Примечания Remarks
Использование метода Refresh эквивалентно выбору параметра Обновить на вкладке Главная. Using the Refresh method is equivalent to choosing Refresh on the Home tab.
Microsoft Access автоматически обновляет записи в соответствии с параметром Интервал обновления на вкладке Дополнительно диалогового окна Параметры Access. Для его открытия нажмите кнопку Microsoft Office и выберите Параметры Access. Microsoft Access refreshes records automatically, based on the Refresh Interval setting on the Advanced tab of the Access Options dialog box, available by choosing the Microsoft Office button, and then choosing Access Options. Источники данных ODBC обновляются в соответствии с параметром Период обновления ODBC на вкладке Дополнительно диалогового окна Параметры Access. ODBC data sources are refreshed based on the ODBC Refresh Interval setting on the Advanced tab of the Access Options dialog box. Метод Refresh можно использовать для просмотра изменений, внесенных в текущий набор записей в форме или таблице, с момента последнего обновления источника записей формы или таблицы. You can use the Refresh method to view changes that have been made to the current set of records in a form or datasheet since the record source underlying the form or datasheet was last refreshed.
В базе данных Access метод Refresh показывает только изменения, внесенные в записи в текущем наборе. In an Access database, the Refresh method shows only changes made to records in the current set. Так как метод Refresh фактически не отправляет запрос в базу данных, текущий набор не будет включать добавленные записи или исключать записи, которые были удалены с момента последнего повторного запроса базы данных, а также не будет исключать записи, которые больше не удовлетворяют условиям запроса или фильтра. Because the Refresh method doesn’t actually requery the database, the current set won’t include records that have been added or exclude records that have been deleted since the database was last requeried, nor will it exclude records that no longer satisfy the criteria of the query or filter. Чтобы повторно запросить базу данных, используйте метод Requery. To requery the database, use the Requery method. При повторном запросе источника записей текущий набор записей будет точно отражать все данные в источнике записей. When the record source for a form is requeried, the current set of records will accurately reflect all data in the record source.
В проекте Access (ADP) метод Refresh повторно запрашивает базу данных и отображает все новые или измененные записи, а также удаляет удаленные записи из таблицы, на которой основана форма. In an Access project (.adp), the Refresh method requeries the database and displays any new or changed records or removes deleted records from the table on which the form is based. Кроме того, форма обновляется для отображения записей на основе всех изменений свойства Filter формы. The form is also updated to display records based on any changes to the Filter property of the form.
- Часто обновление формы или таблицы выполняется быстрее, чем их повторный запрос. It’s often faster to refresh a form or datasheet than to requery it. Это особенно верно, если первоначальный запрос выполнялся медленно. This is especially true if the initial query was slow to run.
- Не путайте метод Refresh с методом Repaint, который перерисовывает экран с помощью всех ожидающихся визуальных изменений. Don’t confuse the Refresh method with the Repaint method, which repaints the screen with any pending visual changes.
Пример Example
В приведенном ниже примере используется метод Refresh для обновления записей в базовом источнике записей для формы Customers, когда форма получает фокус. The following example uses the Refresh method to update the records in the underlying record source for the Customers form whenever the form receives the focus.
Поддержка и обратная связь Support and feedback
Есть вопросы или отзывы, касающиеся Office VBA или этой статьи? Have questions or feedback about Office VBA or this documentation? Руководство по другим способам получения поддержки и отправки отзывов см. в статье Поддержка Office VBA и обратная связь. Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
How to reload or refresh Windows Form into original state?
How to reload or refresh the Windows Form into original state? i have used this.Refresh();,this.Invalidate();,form.Refresh(),form.Invalidate()
I just want to reload the form into original state once the data properly save or updated.
4 Answers 4
These functions just tell the window manager to redraw the form graphic; they have nothing to do with the state of the form’s data.
Seems that all you need to do is set your control values back to their original values So, make a function on the form:
and then in the sucess part of the code call the function:
and you can also include a call to ResetForm() somewhere in your Form_Load , etc.
However
I’d recommend that once you are comfortable with doing this, you then stop doing it and use the data-binding facility that’s built into Winforms; what it allows you to do is use the designer to bind user interface elements on the form (textboxes, etc) to various Class properties (e.g. UserManagement class).
This way you can simply «reset» your form by creating a new instance of UserManagement without having to deal with all the cruddy details of clearing out textboxes, etc. Otherwise you will find as your objects grow more complex, writing the code to manually reset form UI elments becomes more and more tedious and error-prone.
Refresh form windows forms
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:
Question
I have to refresh the main form during closing the sub form.
Answers
What are you meaning to refresh? What about using Refresh() method of the form or calling the Form_load event, when closing sub form?
this.Refresh(); to redraw the contents of the current form
All replies
What are you meaning to refresh? What about using Refresh() method of the form or calling the Form_load event, when closing sub form?
this.Refresh(); to redraw the contents of the current form
Form1 frm=new Form1();
May be this is helpfull for You
i want to use a function under button click and
i want to refresh the present form when the button is clicked
can someone help me with the code?
this.Refresh() command is not applicable when we use it in a thread.
which command is suitable to refresh the Win App form to redraw the contents?
Web Browser. Refresh Method
Definition
Reloads the document currently displayed in the WebBrowser control.
Overloads
Reloads the document currently displayed in the WebBrowser control by checking the server for an updated version.
Reloads the document currently displayed in the WebBrowser control using the specified refresh options.
Refresh()
Reloads the document currently displayed in the WebBrowser control by checking the server for an updated version.
Examples
The following code example demonstrates how to use the Refresh method to implement a Refresh button for the WebBrowser control similar to the one in Internet Explorer. This example requires that your form contains a WebBrowser control called webBrowser1 and a Button control called ButtonRefresh .
Remarks
The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The Refresh method forces the WebBrowser control to reload the current page by downloading it, ensuring that the control displays the latest version. You can use this method to implement a Refresh button similar to the one in Internet Explorer.
A document refresh simply reloads the current page, so the Navigating, Navigated, and DocumentCompleted events do not occur when you call the Refresh method.
Web Browser. Refresh Метод
Определение
Перезагружает документ, отображаемый в текущий момент в элементе управления WebBrowser. Reloads the document currently displayed in the WebBrowser control.
Перегрузки
Перезагружает документ, отображаемый в текущий момент в элементе управления WebBrowser, проверяя наличие обновленной версии на сервере. Reloads the document currently displayed in the WebBrowser control by checking the server for an updated version.
Перезагружает документ, отображаемый в текущий момент в элементе управления WebBrowser, используя для этого заданные параметры обновления. Reloads the document currently displayed in the WebBrowser control using the specified refresh options.
Refresh()
Перезагружает документ, отображаемый в текущий момент в элементе управления WebBrowser, проверяя наличие обновленной версии на сервере. Reloads the document currently displayed in the WebBrowser control by checking the server for an updated version.
Примеры
В следующем примере кода показано, как использовать Refresh метод для реализации кнопки обновления для WebBrowser элемента управления, аналогичного элементу в Internet Explorer. The following code example demonstrates how to use the Refresh method to implement a Refresh button for the WebBrowser control similar to the one in Internet Explorer. В этом примере требуется, чтобы форма содержала WebBrowser элемент управления webBrowser1 и Button вызывался элемент управления ButtonRefresh . This example requires that your form contains a WebBrowser control called webBrowser1 and a Button control called ButtonRefresh .
Комментарии
WebBrowserЭлемент управления хранит веб-страницы с недавно посещенных сайтов в кэше на локальном жестком диске. The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. На каждой странице можно указать дату окончания срока действия, указывающую, как долго она будет оставаться в кэше. Each page can specify an expiration date indicating how long it will remain in the cache. Когда элемент управления переходит на страницу, он экономит время, отображая кэшированную версию, если она доступна, а не загружает ее снова. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. RefreshМетод заставляет WebBrowser элемент управления перезагружать текущую страницу, загружая ее, обеспечивая отображение последней версии элемента управления. The Refresh method forces the WebBrowser control to reload the current page by downloading it, ensuring that the control displays the latest version. Этот метод можно использовать для реализации кнопки обновления , аналогичной той, которая имеется в Internet Explorer. You can use this method to implement a Refresh button similar to the one in Internet Explorer.
Обновление документа просто Перезагружает текущую страницу, поэтому Navigating Navigated события, и DocumentCompleted не происходят при вызове Refresh метода. A document refresh simply reloads the current page, so the Navigating, Navigated, and DocumentCompleted events do not occur when you call the Refresh method.