如何在对话框中创建刷新按钮. [英] how to Create Refresh button in Dialog box.

查看:82
本文介绍了如何在对话框中创建刷新按钮.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在对话框中创建刷新按钮.

这是我程序的对话框程序

告诉我如何使用刷新按钮

how to Create Refresh button in Dialog box.

This the the dialog procedure of my program

tell me what to do with refresh button

BOOL CALLBACK TcpDlgProc (HWND hTcpDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
     switch (message)
     {
     case WM_INITDIALOG :
		  GetTCPConn(hTcpDlg);// this is the function i am calling to get information in dialog box
		  return TRUE ;
          
     case WM_COMMAND :
          switch (LOWORD (wParam))
          {
          case IDOK :
			   EndDialog (hTcpDlg, 0);
			   return TRUE;

          case IDREFRESH :
// What should i do to refresh the content of dialog box
               return TRUE ;
          }
 
	 case WM_DESTROY:
		  EndDialog(hTcpDlg,0);
		  return TRUE ;
          break ;
     }
     return FALSE ;
}

推荐答案

您可以将GetTCPConn()函数拆分为两个函数:

  • 一个初始化函数,用于初始化要在WM_INITDIALOG上调用的控件.
  • 一个更新函数,用于在控件中填充要在IDREFRESH上调用的内容.
You may split your GetTCPConn() function into two functions:

  • An init function that initializes the controls to be called upon WM_INITDIALOG.
  • An update function that fills the controls with content to be called upon IDREFRESH.


我再次调用了相同的函数,并且起作用了..
I called same function again and it worked..


您不能简单地再次从IDREFRESH调用GetTCPConn(hTcpDlg);吗?
Couldn''t you simply call GetTCPConn(hTcpDlg); again from IDREFRESH ?


这篇关于如何在对话框中创建刷新按钮.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆