summary15 scroll

1、CMFCPropertyGridCtrl::OnSelectCombo()

Called by the framework when a property that contains a combo box control is selected.

2、Scroll Control

afx_msg void OnHScroll( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar )的参数和作用分析:

https://blog.csdn.net/lanmeng_smile/article/details/25922949

SCROLLINFO结构体:https://www.cnblogs.com/qingergege/p/4983036.html

函数原型:BOOL GetScrolllnfo(HWND hWnd,int fnBar,LPSCROLLINFO lpsi);

参数: hWnd:滚动条控制或有标准滚动条的窗体句柄,由fnBar参数确定。

              fnBar:指定待找回滚动条参数的类型,此参数可以为如下值,其值含义: SB_CTL:找回滚动条控制参数。其中参数hwnd一定是处理滚动条控制的句柄。

             SB_HORZ:找回所指定窗体的标准水平滚动条参数。

             SB_VERT:找回所指定窗体的标准垂直滚动条参数。 lpsi:指向SCROLLINFO结构。
 


void CMFCScrollDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	// TODO: Add your message handler code here and/or call default
	SCROLLINFO sInfo = { sizeof(SCROLLINFO) };//sInfo.cbSize = sizeof(sInfo);

	if (pScrollBar)
	{
		pScrollBar->GetScrollInfo(&sInfo);
	}
	else
	{
		GetScrollInfo(SB_HORZ, &sInfo);
	}

	switch (nSBCode)
	{
	case(SB_LINELEFT):
	{
		if (sInfo.nPos > sInfo.nMin)
			sInfo.nPos--;
		break;
	}
	case(SB_LINERIGHT):
	{
		if (sInfo.nPos < sInfo.nMax)
			sInfo.nPos++;
		break;
	}
	case(SB_PAGELEFT):
	{
		if (sInfo.nPos > sInfo.nMin)
		{
			sInfo.nPos -= sInfo.nPage;
			if (sInfo.nPos < sInfo.nMin)
				sInfo.nPos = sInfo.nMin;
		}
		break;
	}
	case(SB_PAGERIGHT):
	{
		if (sInfo.nPos < sInfo.nMax)
		{
			sInfo.nPos += sInfo.nPage;
			if (sInfo.nPos > sInfo.nMax)
				sInfo.nPos = sInfo.nMax;
		}
		break;
	}
	case(SB_THUMBPOSITION):
	case(SB_THUMBTRACK):
	{
		sInfo.nPos = nPos;
		break;
	}
	case(SB_LEFT):
	{
		sInfo.nPos = sInfo.nMin;
		break;
	}
	case(SB_RIGHT):
	{
		sInfo.nPos = sInfo.nMax;
		break;
	}
	}

	if (pScrollBar)
		pScrollBar->SetScrollInfo(&sInfo);
	else
		SetScrollInfo(SB_HORZ, &sInfo);

	if (pScrollBar->m_hWnd == m_horiScrollbar.m_hWnd)
	{
		SetDlgItemInt(IDC_HSCROLL_EDIT, pScrollBar->GetScrollPos());
	}

	CDialogEx::OnHScroll(nSBCode, nPos, pScrollBar);
}

为什么要写这几句?

if (pScrollBar)
    {
        pScrollBar->GetScrollInfo(&sInfo);
    }
    else
    {
        GetScrollInfo(SB_HORZ, &sInfo);
    }

 

SB_THUMBPOSITION The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation. 
SB_THUMBTRACK The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The nPos parameter indicates the position that the scroll box has been dragged to. 

<div> <Space direction="vertical" size="large" style={{display: 'flex', marginTop: '1%'}}> <DatePicker onChange={onChange} disabledDate={disabledDate} defaultValue={dayjs()} /> <ProTable<API.EleYj, API.getEleYjByConditionParams & API.PageParams> headerTitle={'深圳市能源换电业务电池总体情况'} rowKey="" bordered search={false} // scroll={{x:true}} scroll={{x: 'max-content', y: 700}} request={async (params) => { console.log(params); return await getEleYjByCondition(params); }} options={{ // show: true, density: true, fullScreen: true, setting: true, } } columns={columns} summary={ () => ( <> <ProTable.Summary.Row className='total' style={{textAlign: 'center'}}> {/* 合计行内容 */} <ProTable.Summary.Cell colSpan={2} index={0} >合计</ProTable.Summary.Cell> <ProTable.Summary.Cell index={2}>3232</ProTable.Summary.Cell> <ProTable.Summary.Cell index={3}>43</ProTable.Summary.Cell> <ProTable.Summary.Cell index={4}>345</ProTable.Summary.Cell> <ProTable.Summary.Cell index={5}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={6}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={7}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={8}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={9}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={10}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={11}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={12}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={13}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={14}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={15}>534</ProTable.Summary.Cell> <ProTable.Summary.Cell index={16}>3232</ProTable.Summary.Cell> </ProTable.Summary.Row> </> )} /> </Space> </div>怎么把datepicker放在protable种
07-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值