c# - Transparent panel can't receive WM_NCHITTEST -
in c# winform project, put panel in form. panel's backcolor same form's transparencykey, looks 'transparent'.
i want form moved when clicking/dragging inside 'transparent' panel. override panel's wndproc below:
public class unclickablepanel : panel { protected override void wndproc(ref message m) { if (m.msg == 0x84) { // wm_nchittest m.result = new intptr(-1); return; } base.wndproc(ref m); } }
in opinion, panel returns "-1"(transparent) , form can handle mouse down/up/move events.
it works fine in win7 aero theme. if win xp or win7 + basic theme, panel can't receive wm_nchittest @ all. click through form.
any solution or workaround?
Comments
Post a Comment