多功能进度条

时间:2020-12-09 03:54:48
【文件属性】:

文件名称:多功能进度条

文件大小:47KB

文件格式:PBL

更新时间:2020-12-09 03:54:48

源码

此程序快速实现多功能进度条。。。。。。 long ll_hdc, ll_hwnd, ll_hRgn ulong ll_hBrushHighCor, ll_hBrushWhiteCor RECT lstr_rect, lstr_LeftRect, lstr_RightRect String ls_Text ls_Text = String(Integer(ide_pos * 100 )) + "%" ll_hBrushHighCor = il_ForeCor ll_hBrushWhiteCor = il_BKCor ll_hBrushHighCor = CreateSolidBrush(il_ForeCor) ll_hBrushWhiteCor = CreateSolidBrush(il_BKCor) ll_hwnd = Handle(This) ll_hdc = GetDC(ll_hwnd) GetClientRect(ll_hwnd, lstr_rect) lstr_LeftRect = lstr_Rect lstr_RightRect = lstr_Rect lstr_LeftRect.Right = lstr_Rect.Left + (lstr_Rect.Right - lstr_Rect.Left)*ide_Pos lstr_RightRect.Left = lstr_LeftRect.Right FillRect(ll_hdc, lstr_LeftRect, ll_hBrushHighCor) FillRect(ll_hdc, lstr_RightRect, ll_hBrushWhiteCor) SetBkMode(ll_hdc, TRANSPARENT) //TRANSPARENT = 1 ll_hRgn = CreateRectRgn(lstr_LeftRect.Left, lstr_LeftRect.Top, lstr_LeftRect.Right, lstr_LeftRect.Bottom) SelectClipRgn(ll_hdc, ll_hRgn) SetTextColor(ll_hdc, il_TextBKCor) DrawText(ll_hdc, ls_Text, -1, lstr_rect, DT_CENTER+DT_VCENTER+DT_SINGLELINE) DeleteObject(ll_hRgn) ll_hRgn = CreateRectRgn(lstr_RightRect.Left, lstr_RightRect.Top, lstr_RightRect.Right, lstr_RightRect.Bottom) SelectClipRgn(ll_hdc, ll_hRgn) SetTextColor(ll_hdc, il_TextForeCor) DrawText(ll_hdc, ls_Text, -1, lstr_rect, DT_CENTER+DT_VCENTER+DT_SINGLELINE) DeleteObject(ll_hRgn) ReleaseDC(ll_hwnd, ll_hdc)


网友评论