{"id":3698,"date":"2018-09-12T10:52:53","date_gmt":"2018-09-12T01:52:53","guid":{"rendered":"https:\/\/elleneast.com\/?p=3698"},"modified":"2018-09-30T11:09:56","modified_gmt":"2018-09-30T02:09:56","slug":"%e3%80%90vb-net%e3%80%91%e3%80%90wpf%e3%80%91window-%e3%81%8c%e9%96%89%e3%81%98%e3%81%9f%e5%be%8c%e3%81%a7%e3%80%81visibility-%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%82%84%e3%80%81show%e3%80%81showdialog","status":"publish","type":"post","link":"https:\/\/elleneast.com\/?p=3698","title":{"rendered":"\u3010VB.NET\u3011\u3010WPF\u3011\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u3066\u304b\u3089\u518d\u3073\u8868\u793a\u3055\u305b\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u308b"},"content":{"rendered":"<p>VB.NET (WPF) \u3067\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3057\u3066\u304b\u3089\u3001\u305d\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4e0a\u306b\u914d\u7f6e\u3057\u305f\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u300c\u304a\u77e5\u3089\u305b\u300d\u304c\u8868\u793a\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u6a5f\u80fd\u3092\u30c6\u30b9\u30c8\u3057\u3066\u3044\u305f\uff08\u30c6\u30b9\u30c8\u4e2d\u3060\u3063\u305f\u306e\u3067\u3001\u4e0b\u56f3\u306e\u304a\u77e5\u3089\u305b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u5909\u3066\u3053\u308a\u3093\u306a\u306e\u306f\u7121\u8996\u3057\u3066\u307b\u3057\u3044\uff09\u3002<\/p>\n<p><a href=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/childWindow2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3708\" src=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/childWindow2.png\" alt=\"\" width=\"713\" height=\"527\" srcset=\"https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/childWindow2.png 713w, https:\/\/elleneast.com\/wp\/wp-content\/uploads\/programming_topics\/childWindow2-300x222.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\"><\/a><\/p>\n<p>\u3068\u3053\u308d\u304c\u3001\u300c\u304a\u77e5\u3089\u305b\u300d\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u3066\u304b\u3089\u518d\u3073\u8868\u793a\u3055\u305b\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3002<\/p>\n<div class=\"sng-box box12\">\n<p>Window \u304c\u9589\u3058\u305f\u5f8c\u3067\u3001Visibility \u306e\u8a2d\u5b9a\u3084\u3001Show\u3001ShowDialog\u3001\u304a\u3088\u3073 WindowInteropHelper.EnsurerHandle \u306e\u547c\u3073\u51fa\u3057\u3092\u884c\u3046\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<\/div>\n<p>\u300c\u3093\uff1f\uff1f\u300d\u5909\u3060\u306a\u3002\u30b3\u30fc\u30c9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u3066\u3082\u3001\u304a\u304b\u3057\u306a\u3068\u3053\u308d\u306f\u306a\u3044\u3088\u3046\u306b\u898b\u3048\u308b\u3002\u7c21\u5358\u306a\u30b3\u30fc\u30c9\u3060\u3002\u3042\u3089\u304b\u3058\u3081 New \u3057\u3066\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306b\u5165\u308c\u3066\u304a\u3044\u305f\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u300c\u304a\u77e5\u3089\u305b\u300d\u3092 .ShowDialog() \u3067\u8868\u793a\u3057\u3066\u3001.Close() \u3067\u9589\u3058\u3066\u308b\u3060\u3051\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u3069\u3046\u3084\u3089\u4ee5\u524d Forms \u3067\u3084\u3063\u3066\u305f\u3053\u306e\u3084\u308a\u65b9\u304c\u901a\u7528\u3057\u306a\u3044\u3089\u3057\u3044\u3002<\/p>\n<p>\u3069\u3046\u3084\u3089 WPF \u3067\u306f\u3001.Close() \u3059\u308b\u3068 New \u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u7834\u68c4\u3055\u308c\u308b\u306e\u3067\u3001\u518d\u3073 New \u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5b9f\u614b\u3092\u5f97\u306a\u3044\u9650\u308a\u306f .ShowDialog() \u304c\u3067\u304d\u306a\u3044\u3089\u3057\u3044\u3002<\/p>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3059\u308b\u306b\u306f\u3001\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304b\u3089\u300c\u304a\u77e5\u3089\u305b\u300d\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u958b\u304f\u3068\u304d\u306f\u6bce\u56de New \u3067\u5b9f\u614b\u3092\u5f97\u308b\u3088\u3046\u306b\u3057\u3066\u3001\u4f7f\u7528\u5f8c\u306b\u6bce\u56de .Close() \u3059\u308b\u3002<br \/>\n\u307e\u305f\u306f\u3001New \u3092\uff11\u56de\u3060\u3051\u306b\u3057\u305f\u3044\u5834\u5408\uff08\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5b9f\u614b\u3092\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306b\u5165\u308c\u3066\u304a\u304d\u305f\u3044\u5834\u5408\uff09\u306f\u30b3\u30fc\u30c9\u3092\u6b21\u306e\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"big\"><strong>\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u9589\u3058\u308b\u30dc\u30bf\u30f3\u306e\u30b3\u30fc\u30c9<\/strong><\/span><\/p>\n<pre class=\"lang:vbnet decode:true\">Me.Visibility = Visibility.Collapsed<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"big\"><strong>\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e Closing \u30a4\u30d9\u30f3\u30c8\u306e\u30b3\u30fc\u30c9<\/strong><\/span><\/p>\n<pre class=\"lang:vbnet decode:true\">e.Cancel = True\nMe.Visibility = Visibility.Collapsed<\/pre>\n<p>.Collapsed \u306e\u304b\u308f\u308a\u306b .Hidden \u3092\u4f7f\u3063\u3066\u3082 OK\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001WPF \u306e\u5834\u5408\u3001\u3053\u308c\u3067\u306f\u307e\u3060\u554f\u984c\u304c\u3042\u308b\u3002<\/p>\n<p>Forms \u306e\u5834\u5408\u306f\u3001\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u308c\u3070\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u3082\u5f37\u5236\u7684\u306b\u9589\u3058\u305f\u306e\u3067\u3053\u308c\u3067\u3082\u826f\u304b\u3063\u305f\u3002\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u660e\u793a\u7684\u306b\u9589\u3058\u306a\u304f\u3066\u3082\u3001\u3042\u308b\u3044\u306f\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e .Closing \u30a4\u30d9\u30f3\u30c8\u306b e.Cancel = True \u3068\u66f8\u3044\u3066\u3042\u3063\u3066\u3082\u3001\u3068\u306b\u304b\u304f\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u308c\u3070\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u3082\u9589\u3058\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057 WPF \u3067\u306f\u3001\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u3066\u3082\u3001\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u81ea\u52d5\u7684\u306b\u9589\u3058\u306a\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3060\u3002\u3064\u307e\u308a\u4eca\u56de\u306e\u5834\u5408\u3001\u4e0b\u8a18\u306e\u3053\u3068\u3092\u5fd8\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u3002<\/p>\n<ul>\n<li>\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u308b\u3068\u304d\u306b\u306f\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u3082\u660e\u793a\u7684\u306b\u9589\u3058\u308b<\/li>\n<li>\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u308b\u3068\u304d\u306b\u306f\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e .Closing \u30a4\u30d9\u30f3\u30c8\u306e e.Cancel = True \u304c\u5b9f\u884c\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u3053\u308c\u3092\u5fd8\u308c\u308b\u3068\u3001\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u3066\u3082\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u9589\u3058\u305a\u3001\u30d7\u30ed\u30bb\u30b9\u304c\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u30d7\u30ed\u30bb\u30b9\u306b\u6b8b\u3063\u3066\u3057\u307e\u3046\u3002<\/p>\n<p>\u5f93\u3063\u3066\u3001\u6700\u7d42\u7684\u306a\u30b3\u30fc\u30c9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"big\"><strong>\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e Closing \u30a4\u30d9\u30f3\u30c8\u306e\u30b3\u30fc\u30c9<\/strong><\/span><\/p>\n<pre class=\"lang:vbnet decode:true\">If gParentAppClosing = False Then\n    e.Cancel = True\n    Me.Visibility = Visibility.Collapsed\nEnd If<\/pre>\n<p>&nbsp;<\/p>\n<p><span class=\"big\"><strong>\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6\u306e Closing \u30a4\u30d9\u30f3\u30c8\u306e\u30b3\u30fc\u30c9<\/strong><\/span><\/p>\n<pre class=\"lang:vbnet decode:true\">gParentAppClosing = True\n\noChildWindow.Close<\/pre>\n<p>&nbsp;<\/p>\n<p>\u203b gParentAppClosing \u306f\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u306f False\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VB.NET (WPF) \u3067\u4f5c\u6210\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3057\u3066\u304b\u3089\u3001\u305d\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4e0a\u306b\u914d\u7f6e\u3057\u305f\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u5b50\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u300c\u304a\u77e5\u3089\u305b\u300d\u304c\u8868\u793a\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u6a5f\u80fd\u3092\u30c6\u30b9\u30c8\u3057\u3066\u3044\u305f\uff08\u30c6\u30b9\u30c8\u4e2d\u3060\u3063\u305f\u306e\u3067\u3001\u4e0b\u56f3\u306e\u304a\u77e5 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2656,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[57],"tags":[60,62],"class_list":{"0":"post-3698","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-57","8":"tag-vb-net","9":"tag-wpf"},"_links":{"self":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/3698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3698"}],"version-history":[{"count":3,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/3698\/revisions"}],"predecessor-version":[{"id":4626,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/posts\/3698\/revisions\/4626"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=\/wp\/v2\/media\/2656"}],"wp:attachment":[{"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elleneast.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}