怎样使PICTURE BOX有MOUSEDOWN,MOUSEUP,DragDrop,DragOver...事件。

jing 2000-02-15 07:19:00
MOUSE的图标怎样变,有没有办法判断MOUSE的图标,还有MOUSE的移动方向(上移,下移,左移,右移);
...全文
220 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jing 2000-02-16
  • 打赏
  • 举报
回复
再谢了,但我说的事件是它没有的。
再问一个问题
如何得到一个控件的句柄?
例如在VIEW ONDRAW时得到一个的BOTTON句柄

qiujoe 2000-02-16
  • 打赏
  • 举报
回复
mouse的移动方向可以用两次mouse之间的位置来判断
当然MOUSE移动时发出WM_MOUSEMOVE的消息,
xPos = LOWORD(lParam);
yPos = HIWORD(lParam);
根据前后两次的位置可以确定MOUSE的移动方向。
sintony 2000-02-16
  • 打赏
  • 举报
回复
只要选择你建立的对象,按右键,选择Event然后将你需要添加的事件Add进去,编辑这个函数即可
jing 2000-02-16
  • 打赏
  • 举报
回复
谢谢你的回答.但用Class Wizard 如何重载呢?对不起我刚接触VC++
sintony 2000-02-15
  • 打赏
  • 举报
回复
用Class Wizard 重载PICTURE BOX的Event即可处理个事件
sintony 2000-02-15
  • 打赏
  • 举报
回复
HCURSOR m_hCursor;
//使用系统光标
IDC_ARROW Standard arrow cursor
IDC_IBEAM Standard text-insertion cursor
IDC_WAIT Hourglass cursor used when Windows performs a time-consuming task
IDC_CROSS Cross-hair cursor for selection
IDC_UPARROW Arrow that points straight up
IDC_SIZE Obsolete and unsupported; use IDC_SIZEALL
IDC_SIZEALL A four-pointed arrow. The cursor to use to resize a window.
IDC_ICON Obsolete and unsupported. Use IDC_ARROW.
IDC_SIZENWSE Two-headed arrow with ends at upper left and lower right
IDC_SIZENESW Two-headed arrow with ends at upper right and lower left
IDC_SIZEWE Horizontal two-headed arrow
IDC_SIZENS Vertical two-headed arrow
Example:
m_hCursor = AfxGetApp()->LoadStandardCursor(IDC_UPARROW);

//使用自定义光标
hCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
//IDC_MYCURSOR在资源编辑其中添加

//最后调用
::SetCursor(m_hCursor);
RAD Studio VCL Reference (VCL参考) ContentsActnColorMaps Namespace Classes TStandardColorMap Class TStandardColorMap Members TStandardColorMap Methods TStandardColorMap.SetColor Method TStandardColorMap.UpdateColors Method TStandardColorMap Properties TStandardColorMap.BtnFrameColor Property TStandardColorMap.BtnSelectedColor Property TStandardColorMap.BtnSelectedFont Property TStandardColorMap.Color Property TStandardColorMap.DisabledColor Property TStandardColorMap.DisabledFontColor Property TStandardColorMap.DisabledFontShadow Property TStandardColorMap.FontColor Property TStandardColorMap.FrameBottomRightInner Property TStandardColorMap.FrameBottomRightOuter Property TStandardColorMap.FrameTopLeftInner Property TStandardColorMap.FrameTopLeftOuter Property TStandardColorMap.HighlightColor Property TStandardColorMap.HotColor Property TStandardColorMap.HotFontColor Property TStandardColorMap.MenuColor Property TStandardColorMap.SelectedColor Property TStandardColorMap.SelectedFontColor Property TStandardColorMap.ShadowColor Property TStandardColorMap.UnusedColor Property TStandardColorMap Events TStandardColorMap.OnColorChange Event TThemedColorMap Class TThemedColorMap Members TThemedColorMap Methods TThemedColorMap.UpdateColors Method TThemedColorMap Properties TThemedColorMap.BtnFrameColor Property TThemedColorMap.BtnSelectedColor Property TThemedColorMap.BtnSelectedFont Property TThemedColorMap.Color Property TThemedColorMap.DisabledColor Property TThemedColorMap.DisabledFontColor Property TThemedColorMap.DisabledFontShadow Property TThemedColorMap.FontColor Property TThemedColorMap.FrameBottomRightInner Property TThemedColorMap.FrameBottomRightOuter Property TThemedColorMap.FrameTopLeftInner Property TThemedColorMap.FrameTopLeftOuter Property TThemedColorMap.HighlightColor Property TThemedColorMap.HotColor Property TThemedColorMap.HotFontColor Property TThemedColorMap.MenuColor Property TThemedColorMap.SelectedColor Property TThemedColorMap.SelectedFontColor Property TThemedColorMap.ShadowColor Property TThemedColorMap.UnusedColor Property TThemedColorMap Events TThemedColorMap.OnColorChange Event TTwilightColorMap Class TTwilightColorMap Members TTwilightColorMap Methods TTwilightColorMap.UpdateColors Method TTwilightColorMap Properties TTwilightColorMap.BtnFrameColor Property TTwilightColorMap.BtnSelectedColor Property TTwilightColorMap.BtnSelectedFont Property TTwilightColorMap.Color Property TTwilightColorMap.DisabledColor Property TTwilightColorMap.DisabledFontColor Property TTwilightColorMap.DisabledFontShadow Property TTwilightColorMap.FontColor Property TTwilightColorMap.FrameBottomRightInner Property TTwilightColorMap.FrameBottomRightOuter Property TTwilightColorMap.FrameTopLeftInner Property TTwilightColorMap.FrameTopLeftOuter Property TTwilightColorMap.HighlightColor Property TTwilightColorMap.HotColor Property TTwilightColorMap.HotFontColor Property TTwilightColorMap.MenuColor Property TTwilightColorMap.SelectedColor Property TTwilightColorMap.SelectedFontColor Property TTwilightColorMap.ShadowColor Property TTwilightColorMap.UnusedColor Property TTwilightColorMap Events TTwilightColorMap.OnColorChange Event TXPColorMap Class TXPColorMap Members TXPColorMap Methods TXPColorMap.UpdateColors Method TXPColorMap Properties TXPColorMap.BtnFrameColor Property TXPColorMap.BtnSelectedColor Property TXPColorMap.BtnSelectedFont Property TXPColorMap.Color Property TXPColorMap.DisabledColor Property TXPColorMap.DisabledFontColor Property TXPColorMap.DisabledFontShadow Property TXPColorMap.FontColor Property TXPColorMap.FrameBottomRightInner Property TXPColorMap.FrameBottomRightOuter Property TXPColorMap.FrameTopLeftInner Property TXPColorMap.FrameTopLeftOuter Property TXPColorMap.HighlightColor Property TXPColorMap.HotColor Property TXPColorMap.HotFontColor Property TXPColorMap.MenuColor Property TXPColorMap.SelectedColor Property TXPColorMap.SelectedFontColor Property TXPColorMap.ShadowColor Property TXPColorMap.UnusedColor Property TXPColorMap Events TXPColorMap.OnColorChange Event Constants ActnColorMaps.cXPBtnFrameColor Constant ActnColorMaps.cXPFrameOuter Constant ActnColorMaps.cXPSelectedColor Constant ActnCtrls Namespace Classes TActionToolBar Class TActionToolBar Members TActionToolBar Properties TActionToolBar.ActionManager Property TActionToolBar.Align Property TActionToolBar.AllowHiding Property TActionToolBar.Anchors Property TActionToolBar.BiDiMode Property TActionToolBar.Canvas Property TActionToolBar.Caption Property TActionToolBar.Color Property TActionToolBar.ColorMap Property TActionToolBar.Constraints Property TActionToolBar.Cursor Property TActionToolBar.DragCursor Property TActionToolBar.DragKind Property TActionToolBar.DragMode Property TActionToolBar.EdgeBorders Property TActionToolBar.EdgeInner Property TActionToolBar.EdgeOuter Property TActionToolBar.Enabled Property TActionToolBar.Font Property TActionToolBar.HorzMargin Property TActionToolBar.HorzSeparator Property TActionToolBar.Orientation Property TActionToolBar.ParentBackground Property TActionToolBar.ParentBiDiMode Property TActionToolBar.ParentColor Property TActionToolBar.ParentFont Property TActionToolBar.ParentShowHint Property TActionToolBar.PersistentHotKeys Property TActionToolBar.PopupMenu Property TActionToolBar.ShowHint Property TActionToolBar.Spacing Property TActionToolBar.VertMargin Property TActionToolBar.Visible Property TActionToolBar Events TActionToolBar.OnAlignInsertBefore Event TActionToolBar.OnAlignPosition Event TActionToolBar.OnCanResize Event TActionToolBar.OnClick Event TActionToolBar.OnConstrainedResize Event TActionToolBar.OnContextPopup Event TActionToolBar.OnControlCreated Event TActionToolBar.OnDblClick Event TActionToolBar.OnDockDrop Event TActionToolBar.OnDockOver Event TActionToolBar.OnDragDrop Event TActionToolBar.OnDragOver Event TActionToolBar.OnEndDock Event TActionToolBar.OnEndDrag Event TActionToolBar.OnEnter Event TActionToolBar.OnExit Event TActionToolBar.OnGetControlClass Event TActionToolBar.OnGetSiteInfo Event TActionToolBar.OnMouseActivate Event TActionToolBar.OnMouseDown Event TActionToolBar.OnMouseMove Event TActionToolBar.OnMouseUp Event TActionToolBar.OnPaint Event TActionToolBar.OnResize Event TActionToolBar.OnStartDock Event TActionToolBar.OnStartDrag Event TActionToolBar.OnUnDock Event TCustomActionCombo Class TCustomActionCombo Members TCustomActionCombo Methods TCustomActionCombo.BeginAutoDrag Method TCustomActionCombo.ComboWndProc Method TCustomActionCombo.DesignWndProc Method TCustomActionCombo.DragDrop Method TCustomActionCombo.DragOver Method TCustomActionCombo Properties TCustomActionCombo.DragMode Property TCustomActionCombo Events TCustomActionCombo.OnClick Event TCustomActionDockBar Class TCustomActionDockBar Members TCustomActionDockBar.Create Constructor TCustomActionDockBar Fields TCustomActionDockBar.FControlHeightIndexes Field TCustomActionDockBar.FScrollDown Field TCustomActionDockBar.FScrollUp Field TCustomActionDockBar Methods TCustomActionDockBar.CalcDockedWidth Method TCustomActionDockBar.CreateControls Method TCustomActionDockBar.CreateScrollButtons Method TCustomActionDockBar.CustomAlignPosition Method TCustomActionDockBar.Dock Method TCustomActionDockBar.DoEndDock Method TCustomActionDockBar.DoScrollDown Method TCustomActionDockBar.DoScrollUp Method TCustomActionDockBar.DoStartDock Method TCustomActionDockBar.GenerateControlHeightLookup Method TCustomActionDockBar.GetFloatingDockSiteClass Method TCustomActionDockBar.GetSiteInfo Method TCustomActionDockBar.Loaded Method TCustomActionDockBar.MakeLastItemVisible Method TCustomActionDockBar.Resize Method TCustomActionDockBar.SetOrientation Method TCustomActionDockBar.SetupScrolling Method TCustomActionDockBar.ShowScrollButtons Method TCustomActionDockBar Properties TCustomActionDockBar.AllowScrolling Property TCustomActionDockBar.ScrollingRate Property TCustomActionDockBar.VisibleIndex Property TCustomActionToolBar Class TCustomActionToolBar Members TCustomActionToolBar.Create Constructor TCustomActionToolBar.Destroy Destructor TCustomActionToolBar Fields TCustomActionToolBar.FHiddenItems Field TCustomActionToolBar.FPopupBar Field TCustomActionToolBar.FScrollBtn Field TCustomActionToolBar Methods TCustomActionToolBar.AutoSizingChanged Method TCustomActionToolBar.CalcButtonWidth Method TCustomActionToolBar.CalcDockedWidth Method TCustomActionToolBar.CMColorchanged Method TCustomActionToolBar.CreateControl Method TCustomActionToolBar.CreateControls Method TCustomActionToolBar.DisableHiding Method TCustomActionToolBar.DoDropCategory Method TCustomActionToolBar.DoScrollBtnClick Method TCustomActionToolBar.DragDrop Method TCustomActionToolBar.DrawBackground Method TCustomActionToolBar.DrawSeparator Method TCustomActionToolBar.EnableHiding Method TCustomActionToolBar.GetControlClass Method TCustomActionToolBar.GetPopupClass Method TCustomActionToolBar.GetScrollBtnClass Method TCustomActionToolBar.HideUnusedItems Method TCustomActionToolBar.Reset Method TCustomActionToolBar.SetBounds Method TCustomActionToolBar.SetOrientation Method TCustomActionToolBar.SetupDropDownBtn Method TCustomActionToolBar Properties TCustomActionToolBar.HiddenCount Property TCustomButtonControl Class TCustomButtonControl Members TCustomButtonControl.Create Constructor TCustomButtonControl Fields TCustomButtonControl.FFlat Field TCustomButtonControl.FState Field TCustomButtonControl Methods TCustomButtonControl.CalcBounds Method TCustomButtonControl.Click Method TCustomButtonControl.CMDialogChar Method TCustomButtonControl.CMEnabledChanged Method TCustomButtonControl.CMMouseEnter Method TCustomButtonControl.CMMouseLeave Method TCustomButtonControl.CMTextChanged Method TCustomButtonControl.DrawBackground Method TCustomButtonControl.DrawFrame Method TCustomButtonControl.DrawLargeGlyph Method TCustomButtonControl.GetShowShortCut Method TCustomButtonControl.Loaded Method TCustomButtonControl.MouseDown Method TCustomButtonControl.MouseMove Method TCustomButtonControl.MouseUp Method TCustomButtonControl.Paint Method TCustomButtonControl.SetActionClient Method TCustomButtonControl.SetBounds Method TCustomButtonControl.SetGlyphLayout Method TCustomButtonControl.SetSelected Method TCustomButtonControl.WMLButtonDblClk Method TCustomButtonControl Properties TCustomButtonControl.AllowAllUp Property TCustomButtonControl.Caption Property TCustomButtonControl.Down Property TCustomButtonControl.Flat Property TCustomButtonControl.MouseInControl Property TCustomButtonControl.ShowCaption Property TCustomButtonControl.ShowShortCut Property TCustomButtonControl.State Property TCustomButtonControl.TrackButton Property TCustomComboControl Class TCustomComboControl Members ........(全)

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧