movable

Making a moveable control in WPF

自闭症网瘾萝莉.ら 提交于 2019-11-27 16:32:07
问题 I have a panel, within that panel are several rectangular controls (the number of controls vaires) I want the user to be able to move the controls around within the panel so that they can arrange the controls in the way that suits them best. does anyone have any resources i could read or simple tips which would get me headed down the right road? thanks 回答1: You can find a lot of inspiration here: http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx http://www.codeproject.com/KB/WPF

std::map<>::insert using non-copyable objects and uniform initialization

六月ゝ 毕业季﹏ 提交于 2019-11-26 21:33:25
问题 Have a look at the following code: #include <utility> #include <map> // non-copyable but movable struct non_copyable { non_copyable() = default; non_copyable(non_copyable&&) = default; non_copyable& operator=(non_copyable&&) = default; // you shall not copy non_copyable(const non_copyable&) = delete; non_copyable& operator=(const non_copyable&) = delete; }; int main() { std::map<int, non_copyable> map; //map.insert({ 1, non_copyable() }); < FAILS map.insert(std::make_pair(1, non_copyable()));

Make a borderless form movable?

空扰寡人 提交于 2019-11-25 23:30:28
问题 Is there a way to make a form that has no border (FormBorderStyle is set to \"none\") movable when the mouse is clicked down on the form just as if there was a border? 回答1: This article on CodeProject details a technique. Is basically boils down to: public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [System.Runtime