{"id":139,"date":"2014-07-10T00:58:02","date_gmt":"2014-07-09T16:58:02","guid":{"rendered":"http:\/\/the-takeo.expressweb.jp\/?p=139"},"modified":"2015-09-24T22:03:22","modified_gmt":"2015-09-24T13:03:22","slug":"invoke%e3%81%a7form%e3%82%92close%e3%81%97%e3%81%a6%e3%80%81%e3%81%9d%e3%81%ae%e5%be%8c%e3%81%99%e3%81%90%e3%81%ab%e5%90%8c%e3%81%98form%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%82%92","status":"publish","type":"post","link":"http:\/\/the-takeo.com\/?p=139","title":{"rendered":"Invoke\u3067Form\u3092Close\u3057\u3066\u3001\u305d\u306e\u5f8c\u3059\u3050\u306b\u540c\u3058Form\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3059\u308b\u3068\u304d\u306e\u6ce8\u610f\u70b9"},"content":{"rendered":"<p>\u30bf\u30a4\u30c8\u30eb\u304c\u9577\u304f\u306a\u3063\u305f\u3002<br \/>\n\u3061\u306a\u307f\u306b\u691c\u8a3c\u3067\u304d\u306a\u3044\u306e\u3067\u5185\u5bb9\u7684\u306b\u9593\u9055\u3063\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u89e3\u6c7a\u65b9\u6cd5\u3082\u6700\u5584\u89e3\u3067\u306f\u306a\u3044\u3067\u3059\u3002<br \/>\n\u5b8c\u5168\u306b\u81ea\u5206\u306e\u899a\u3048\u66f8\u304d\u7528\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<pre lang=\"csharp\" line=\"1\">\r\nSampleForm form=new SampleForm();\r\n\r\npublic void Reflesh()\r\n{\r\n    \/\/ (\u4e2d\u75651)\r\n    form.Invoke(new MethodInvoker(form.Close));\r\n    \/\/ (\u4e2d\u75652)\r\n    form=new SampleForm();\r\n    \/\/ (\u4e2d\u75653)\r\n    form.Show();\r\n}\r\n<\/pre>\n<p>\u304a\u304a\u307e\u304b\u306b\u8a00\u3046\u3068\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u305f\u3002<br \/>\nInvoke\u3057\u3066\u308b\u306e\u306f\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u304cUI\u30b9\u30ec\u30c3\u30c9\u3067\u306a\u3044\u5225\u30b9\u30ec\u30c3\u30c9\u3067\u5b9f\u884c\u3055\u308c\u308b\u304b\u3089\u3067\u3059\u3002<br \/>\n\u7c21\u5358\u306b\u8a00\u3046\u3068\u300c\u4eca\u8868\u793a\u3055\u308c\u3066\u3044\u308bSampleForm\u3092\u9589\u3058\u3066\u3001\u521d\u671f\u5316\u3057\u3066\u518d\u5ea6\u8868\u793a\u3059\u308b\u300d\u3068\u3044\u3046\u5b9f\u884c\u5185\u5bb9\u3002<\/p>\n<p>\u3067\u3001\u3053\u308c\u304c\u3044\u3056\u5b9f\u884c\u3059\u308b\u3068\u30cf\u30f3\u30b0\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3002<br \/>\n\u56f0\u3063\u305f\u306e\u306f\u3001100%\u3067\u306a\u304f\u3001\u8d77\u3053\u3063\u305f\u308a\u8d77\u3053\u3089\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3068\u3053\u308d\u3067\u3042\u308b\u3002<\/p>\n<p>form.Show()\u306e\u76f4\u524d\u3067\u30d6\u30ec\u30a4\u30af\u3057\u3066\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u3068\u3001\u3069\u3046\u3084\u3089\u3053\u3053\u3067form\u304cDispose\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u3002<br \/>\n\u3057\u304b\u3057\u3001\/\/ (\u4e2d\u75652)\u3084\/\/ (\u4e2d\u75653)\u306e\u3069\u3053\u306b\u3082form\u3092Dispose\u3059\u308b\u8981\u7d20\u304c\u306a\u3044\u3002<br \/>\n\u3088\u308a\u8a73\u7d30\u306b\u898b\u3088\u3046\u3068\u3001\/\/ (\u4e2d\u75652)\u306b\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u7f6e\u3044\u3066\u30c7\u30d0\u30c3\u30b0\u3057\u305f\u3068\u3053\u308d\u3001\u554f\u984c\u304c\u4e00\u5207\u767a\u751f\u3057\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n<p>\u3057\u3070\u3089\u304f\u982d\u3092\u637b\u3063\u3066\u3044\u305f\u304c\u3001\u3088\u3046\u3084\u304f\u5c24\u3082\u3089\u3057\u3044\u4eee\u8aac\u304c\u898b\u3064\u304b\u3063\u305f\u3002<\/p>\n<p><strong>Invoke\u3055\u308c\u305fClose\u306b\u3088\u308bDispose\u51e6\u7406\u304c\u3001\u300cform=new SampleForm()\u300d\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u3001<br \/>\n\u6298\u89d2\u521d\u671f\u5316\u3057\u305fform\u304cDispose\u3055\u308c\u3066\u3057\u307e\u3063\u305f\u3002<\/strong><\/p>\n<p>\u30b7\u30ca\u30ea\u30aa\u306f\u3053\u3046\u3060\u3002<\/p>\n<p>1)(\u51e6\u7406\u30b9\u30ec\u30c3\u30c9)Close\u3092UI\u30b9\u30ec\u30c3\u30c9\u306b\u8a17\u3059<br \/>\n2)(UI\u30b9\u30ec\u30c3\u30c9)form\u3092Close\u3059\u308b<br \/>\n3)(\u51e6\u7406\u30b9\u30ec\u30c3\u30c9)\u51e6\u7406\u30b9\u30ec\u30c3\u30c9form\u3092\u521d\u671f\u5316\u3059\u308b<br \/>\n<strong>4)(UI\u30b9\u30ec\u30c3\u30c9)Close\u3057\u305f\u3053\u3068\u3060\u3057\u3001form\u3092Dispose\u3059\u308b<\/strong><br \/>\n5)(\u51e6\u7406\u30b9\u30ec\u30c3\u30c9)form\u3092Show\u3059\u308b<br \/>\n\u2193<br \/>\nform\u306fDispose\u3055\u308c\u3066\u308b\u304b\u3089\u7121\u7406\u3067\u3059\u3088\u301c\u3060\u3002<\/p>\n<p>4\u304c3\u30685\u306e\u9593\u306b\u8d77\u3053\u308b\u3068\u672c\u4ef6\u304c\u767a\u751f\u3059\u308b\u3002<br \/>\n\u305d\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306f\u74b0\u5883\u306e\u72b6\u614b\u306b\u3088\u308b\u306e\u3067\u3001\u554f\u984c\u304c\u767a\u751f\u3057\u305f\u308a\u3057\u306a\u304b\u3063\u305f\u308a\u3057\u305f\u8a33\u3060\u3002<\/p>\n<p>\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b1\u884c\u8ffd\u52a0\u3057\u3066\u554f\u984c\u306f\u767a\u751f\u3057\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n<pre lang=\"csharp\" line=\"1\">\r\n    form.Invoke(new MethodInvoker(form.Close));\r\n    Application.DoEvents();\r\n    \/\/ (\u4e2d\u75652)\r\n<\/pre>\n<p>\u4e00\u5ea6\u305f\u307e\u3063\u3066\u3044\u308b\u51e6\u7406(Close\u542b\u3080\u3001\u3063\u3066\u304b\u591a\u5206Close\u3057\u304b\u306a\u3044)\u3092\u5168\u3066\u5b9f\u884c\u3055\u305b\u308c\u3070\u3044\u3044\u306e\u3060\u3002<br \/>\nMutex\u3092\u4f7f\u3046\u7b49\u3057\u3066\u6392\u4ed6\u5236\u5fa1\u3092\u3057\u305f\u65b9\u304c\u6b63\u78ba\u3060\u304c\u3001\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u6210\u308a\u304b\u306d\u306a\u3044\u306e\u3067\u3053\u306e\u65b9\u6cd5\u306b\u3057\u305f\u3002<br \/>\n\u3061\u3087\u3063\u3068\u4e0d\u5b89\u3067\u306f\u3042\u308b\u3051\u3069\u3001\u3053\u308c\u3067\u554f\u984c\u306a\u3055\u305d\u3046\u306a\u3089\u3053\u308c\u3067\u884c\u3053\u3046\u3068\u601d\u3046\u3002<\/p>\n<p>\u6614\u300c\u304a\u307e\u3058\u306a\u3044\u3060\u300d\u3068\u8a00\u308f\u308c\u305fApplication.DoEvents()\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u3068\u306f\u306a\u3041\u3002<br \/>\n\u30cd\u30c3\u30c8\u3067\u8abf\u3079\u305f\u3089\u3042\u307e\u308a\u52e7\u3081\u3089\u308c\u306a\u3044\u65b9\u6cd5\u3089\u3057\u3044\u3051\u3069\u3001\u305d\u3053\u307e\u3067\u5fc5\u6b7b\u306b\u76f4\u3059\u7b87\u6240\u3058\u3083\u306a\u3044\u304b\u3089\u306d\u3002\u4ed5\u65b9\u306a\u3044\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30bf\u30a4\u30c8\u30eb\u304c\u9577\u304f\u306a\u3063\u305f\u3002 \u3061\u306a\u307f\u306b\u691c\u8a3c\u3067\u304d\u306a\u3044\u306e\u3067\u5185\u5bb9\u7684\u306b\u9593\u9055\u3063\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u89e3\u6c7a\u65b9\u6cd5\u3082\u6700\u5584\u89e3\u3067\u306f\u306a\u3044\u3067\u3059\u3002 \u5b8c\u5168\u306b\u81ea\u5206\u306e\u899a\u3048\u66f8\u304d\u7528\u306e\u8a18\u4e8b\u3067\u3059\u3002 SampleForm form=new SampleForm(); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-c","category-programming"],"_links":{"self":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":1,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":224,"href":"http:\/\/the-takeo.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/224"}],"wp:attachment":[{"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/the-takeo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}