⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewinfo.cpp

📁 完整的汽配查询软件
💻 CPP
字号:
// ViewInfo.cpp : implementation file
//

#include "stdafx.h"
#include "TProd.h"
#include "ViewInfo.h"
#include "XPButton.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CViewInfo dialog


CViewInfo::CViewInfo(CWnd* pParent /*=NULL*/)
	: CDialog(CViewInfo::IDD, pParent)
{
	//{{AFX_DATA_INIT(CViewInfo)
	m_appname = _T("");
	m_prodname = _T("");
	m_kgs = _T("");
	m_oeno = _T("");
	m_qty = _T("");
	m_size = _T("");
	m_tpno = _T("");
	m_oe = _T("");
	//}}AFX_DATA_INIT
}


void CViewInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CViewInfo)
	DDX_Control(pDX, IDOK, m_vok);
	DDX_Control(pDX, IDC_TPNO, m_8);
	DDX_Control(pDX, IDC_QTY, m_7);
	DDX_Control(pDX, IDC_OENO, m_6);
	DDX_Control(pDX, IDC_OE, m_5);
	DDX_Control(pDX, IDC_KGS, m_4);
	DDX_Control(pDX, IDC_INFOSIZE, m_3);
	DDX_Control(pDX, IDC_ARTCILE, m_2);
	DDX_Control(pDX, IDC_APPLICATION, m_1);
	DDX_Control(pDX, IDC_PIC, m_ctrlPicture);
	DDX_Text(pDX, IDC_APPLICATION, m_appname);
	DDX_Text(pDX, IDC_ARTCILE, m_prodname);
	DDX_Text(pDX, IDC_KGS, m_kgs);
	DDX_Text(pDX, IDC_OENO, m_oeno);
	DDX_Text(pDX, IDC_QTY, m_qty);
	DDX_Text(pDX, IDC_INFOSIZE, m_size);
	DDX_Text(pDX, IDC_TPNO, m_tpno);
	DDX_Text(pDX, IDC_OE, m_oe);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CViewInfo, CDialog)
	//{{AFX_MSG_MAP(CViewInfo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CViewInfo message handlers

BOOL CViewInfo::OnInitDialog() 
{
	CDialog::OnInitDialog();
	GetProgramPath();

	CString picpath,picpathjd;
	picpath="image\\"+m_picname+".jpg";
//	picpath="1.jpg";

	picpathjd=exeFullPath+picpath;
	m_ctrlPicture.SetImage(picpathjd);
	const int nAddConst=1000;
     //图象尺寸不会正合适,需要加点增量。
    long lPictureWidth=m_ctrlPicture.GetImageWidth();
    long lPictureHeight=m_ctrlPicture.GetImageHeight();
    // MoveWindow(0,0,lPictureWidth,lPictureHeight,true);
     //改变对话框大小

     //改变控件的大小
	m_ctrlPicture.MoveWindow(0,0,lPictureWidth,lPictureHeight+nAddConst,true);
	m_ctrlPicture.Display();	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CViewInfo::GetProgramPath()
{

			//程序完全路径
	char *path;
	GetModuleFileName(NULL,exeFullPath,MAX_PATH);

	//分离路径
	path = exeFullPath;
	while(strchr(path,'\\')) 
	{
		path = strchr(path,'\\');
		path++;
	}
	*path ='\0';
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -