VS2012在主对话框设置button,点击后弹出子对话框,上有listbox控件显示图片路径,怎样设置鼠标双击响应使用户双击后能跳转至主对话框并在主对话框的picturecontrol打开并显示该图片呢?
初学MFC,求具体代码例程详解。对话框图片listboxvs2012mfc
初学MFC,求具体代码例程详解。对话框图片listboxvs2012mfc
解决方案 »
- LPCTSTR形参的函数为什么可以用CString对象传进去??
- 用TransmitFile传送文件时,很多文件都是只传输一般就成功返回了
- 线程问题
- 高手请进,请问如何实现软件中插件的热插拔?
- 关于从USB接口得到数据的串口通讯方面的书籍
- 怎样编写带输出参数的函数
- 如何建立和使用自定义函数?
- 请教!!!!!!!!!!
- 一个简单的C程序 ,在TC中编译说语法错误,怎么回事?
- 请问如何防止木马模拟人的动作在网页地址栏里输入字母和回车
- VC控制台使用Lib 弹出提示"the procedure entry point DirSelectPopupEx could not be located.
- 大家帮忙看看这个异常
void CMainDlg::OnBnClickedButton1()
{
CChildDlg dlg;
if( IDOK == dlg.DoModal() )
{
//这里子对话框双击LISTBOX后调用 OnOk()
CString strPic = dlg.m_strPicPath;//这里就是子对话框双击后保存的图片路径
}
}//子对话框双击LISTBOX事件代码
void CChildDlg::OnLbnDblclkList1()
{
int nIndex = m_ListBox.GetCurSel();
if( LB_ERR != nIndex )
{
// get the content of the selected item
m_List.GetText( nIndex, m_strPicPath );
}
OnOk();
}
void CMainDlg::OnBnClickedButton1()
{
CChildDlg dlg;
if( IDOK == dlg.DoModal() )
{
//这里子对话框双击LISTBOX后调用 OnOk()
CString strPic = dlg.m_strPicPath;//这里就是子对话框双击后保存的图片路径
}
}//子对话框双击LISTBOX事件代码
void CChildDlg::OnLbnDblclkList1()
{
int nIndex = m_ListBox.GetCurSel();
if( LB_ERR != nIndex )
{
// get the content of the selected item
m_List.GetText( nIndex, m_strPicPath );
}
OnOk();
}
解决啦~多谢!
void CMainDlg::OnBnClickedButton1()
{
CChildDlg dlg;
if( IDOK == dlg.DoModal() )
{
//这里子对话框双击LISTBOX后调用 OnOk()
CString strPic = dlg.m_strPicPath;//这里就是子对话框双击后保存的图片路径
}
}//子对话框双击LISTBOX事件代码
void CChildDlg::OnLbnDblclkList1()
{
int nIndex = m_ListBox.GetCurSel();
if( LB_ERR != nIndex )
{
// get the content of the selected item
m_List.GetText( nIndex, m_strPicPath );
}
OnOk();
}还想问一下,这样的话就不是双击响应了啊,只要鼠标单击就会回到主对话框。