{"id":421,"date":"2016-12-10T08:55:44","date_gmt":"2016-12-09T23:55:44","guid":{"rendered":"https:\/\/onaraboo.com\/?p=421"},"modified":"2017-01-25T08:44:02","modified_gmt":"2017-01-24T23:44:02","slug":"visual-baseic-net-%e3%81%84%e3%82%8d%e3%81%84%e3%82%8d%e3%81%aa%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af7","status":"publish","type":"post","link":"https:\/\/onaraboo.com\/?p=421","title":{"rendered":"Visual Basic.NET \u3044\u308d\u3044\u308d\u306a\u30c6\u30af\u30cb\u30c3\u30af7"},"content":{"rendered":"<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/onaraboo.com\/?p=421\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/onaraboo.com\/?p=421\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Visual Basic.NET \u3044\u308d\u3044\u308d\u306a\u30c6\u30af\u30cb\u30c3\u30af7\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img loading=\"lazy\" decoding=\"async\" src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_line\"><a href='http:\/\/line.me\/R\/msg\/text\/?Visual%20Basic.NET%20%E3%81%84%E3%82%8D%E3%81%84%E3%82%8D%E3%81%AA%E3%83%86%E3%82%AF%E3%83%8B%E3%83%83%E3%82%AF7%0D%0Ahttps%3A%2F%2Fonaraboo.com%2F%3Fp%3D421' title='LINE\u3067\u9001\u308b' rel=nofollow class='wp_social_bookmarking_light_a' ><img src='https:\/\/onaraboo.com\/wordpress\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/line20x20.png' alt='LINE\u3067\u9001\u308b' title='LINE\u3067\u9001\u308b' width='20' height='20' class='wp_social_bookmarking_light_img' \/><\/a><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/onaraboo.com\/?p=421\" data-text=\"Visual Basic.NET \u3044\u308d\u3044\u308d\u306a\u30c6\u30af\u30cb\u30c3\u30af7\" data-lang=\"ja\">Tweet<\/a><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n<p>\u696d\u52d9\u30a2\u30d7\u30ea\u3067\u4f7f\u7528\u3067\u304d\u305d\u3046\u306a\u3082\u306e\u3092\u4e94\u6708\u96e8\u306b\u8a18\u9332\u3057\u3066\u304a\u304f\u3002<br \/>\n\u307e\u3068\u307e\u308b\u307e\u3067\u5f85\u3063\u3066\u3044\u308b\u3068\u5fd8\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u306b\uff65\uff65\uff65\u3002\uff57\uff57<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30d6\u30ed\u30b0\u5185\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30bd\u30fc\u30b9\u306e\u8ee2\u8f09\u30fb\u8ee2\u7528\u306b\u3064\u3044\u3066\u306f\u4f55\u3082\u7e1b\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u3054\u4f7f\u7528\u306e\u72b6\u6cc1\u306e\u5982\u4f55\u306b\u554f\u308f\u305a\u3001\u4f5c\u8005\u305f\u308b\u5f53\u65b9\u306f\u7d50\u679c\u306b\u3064\u3044\u3066\u305d\u306e\u8cac\u4efb\u3092\u4e00\u5207\u8ca0\u3044\u307e\u305b\u3093\u3002\u3054\u4f7f\u7528\u306f\u81ea\u5df1\u8cac\u4efb\u306e\u7bc4\u56f2\u3067\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1<\/p>\n<h2>\u3010\u30a8\u30e9\u30fc\uff08\u4f8b\u5916\uff09\u3092\u767a\u751f\u3055\u305b\u308b\u3011<\/h2>\n<p>\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3084\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u554f\u984c\u7121\u304f\u3066\u3082\u904b\u7528\u4e0a\u3067\u554f\u984c\u3068\u306a\u308b\u51e6\u7406\uff08\u623b\u308a\u5024\u306e\u7570\u5e38\u306a\u3069\uff09\u3067\u305d\u306e\u307e\u307e\u5f8c\u7d9a\u306e\u51e6\u7406\u304c\u8d70\u3063\u3066\u306f\u56f0\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u901a\u5e38\u306f\u30a8\u30e9\u30fc\u3092\u300cTry \uff5e Catch ex As Exception\u300d\u3067\u62fe\u3063\u3066\u3044\u308b\u3088\u3046\u306a\u51e6\u7406\u306e\u5834\u5408\u306b\u5f15\u3063\u304b\u304b\u3089\u306a\u3044\u985e\u306e\u3082\u306e\u3067\u610f\u56f3\u7684\u306b\u3072\u3063\u304b\u3051\u305f\u3044\u5834\u5408\u306b\u5229\u7528\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002\u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u3082\u81ea\u5206\u3067\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<br \/>\n\u300cTry \uff5e Catch ex As Exception\u300d\u3067\u3072\u3063\u304b\u3051\u308b\u306e\u306b\u4f7f\u3044\u307e\u3059\u306e\u3067\u4f8b\u5916\u3092\u767a\u751f\u3055\u305b\u308b\u30a4\u30e1\u30fc\u30b8\u3068\u3068\u3089\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n  Throw New Exception(&quot;\uff21\u51e6\u7406\u306e\u9014\u4e2d\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;)\r\n<\/pre>\n<p>Exception\u306e\u5f8c\u306b\u4f8b\u5916\u5185\u5bb9\u3092\u81ea\u5206\u3067\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u767a\u751f\u5143\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u306b\u7acb\u3061\u307e\u3059\u3002<br \/>\n\u4ed5\u639b\u3051\u904e\u304e\u3068Throw\u3057\u3066\u307e\u3059\u306e\u3067\u547c\u3073\u51fa\u3057\u5143\u306b\u623b\u3063\u3066\u4f8b\u5916\u3092\u5410\u304f\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u610f\u5916\u3068\u601d\u3063\u305f\u5834\u6240\u3068\u306f\u9055\u3046\u3068\u3053\u308d\u3067\u4f8b\u5916\u3092\u78ba\u8a8d\u3057\u3066\u3057\u307e\u3046\u30cf\u30e1\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u203b\u4f8b<br \/>\n\u300cTry \uff5e Catch ex As Exception\u300d\u306e\u4e2d\u3067\u300cThrow New \u300d\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306f\u540c\u3058\u30b9\u30b3\u30fc\u30d7\u5185\u306e\u300cCatch ex As Exception\u300d\u3067\u62fe\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n  Try\r\n      If SampleProcess(intA) = False Then\r\n        '\u7279\u5b9a\u306e\u6761\u4ef6\u306e\u6642\u306b\u30a8\u30e9\u30fc(\u4f8b\u5916)\u3092\u767a\u751f\r\n        Throw New Exception(&quot;SampleProcess\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot;)\r\n      End If\r\n  \r\n  Catch ex As Exception\r\n     MessageBox.Show(ex.Message,&quot;\u4f8b\u5916\u5185\u5bb9&quot;,MessageBoxButtons.OK, MessageBoxIcon.Error)\r\n  End Try\r\n<\/pre>\n<p>\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1\u25a0\u25a1<\/p>\n<h2>\u3010ComboBox\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u5024\u3092List\u306b\u5165\u308c\u308b\u3011<\/h2>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u72b6\u6cc1\u306b\u3088\u3063\u3066\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u306e\u9078\u629e\u9805\u76ee\u3092\u53ef\u5909\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u307e\u3057\u305f\u3002<br \/>\n\u305d\u3093\u306a\u4e2d\u3001\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u306e\u9805\u76ee\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u30d9\u30bf\u30d9\u30bf\u66f8\u304f\u306e\u3067\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u306b\u306a\u3063\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3067\u5019\u88dc\u3092\u53d6\u308c\u306a\u3044\u304b\u3068\u8db3\u63bb\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h4>\u3084\u308a\u305f\u3044\u3053\u3068\u2460<\/h4>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u306e\u9805\u76eeID\u3068\u9805\u76ee\u540d\u3092\u767b\u9332\u3057\u3066\u305d\u308c\u3092\u8868\u793a\u3059\u308b<\/p>\n<h3>\u2460\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5b9a\u7fa9<\/h3>\n<p>\u2193\u3053\u3093\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u9805\u76ee\u30de\u30b9\u30bf\uff09<br \/>\n<a href=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_1-300x30.jpg\" alt=\"\" width=\"300\" height=\"30\" class=\"alignnone size-medium wp-image-426\" srcset=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_1-300x30.jpg 300w, https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_1-768x77.jpg 768w, https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_1.jpg 969w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u2193\u30c7\u30fc\u30bf\u306f\u3053\u3093\u306a\u611f\u3058\u3067<br \/>\n<a href=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_2.jpg\" alt=\"\" width=\"288\" height=\"214\" class=\"alignnone size-full wp-image-427\" \/><\/a><\/p>\n<h3>\u2461\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092<\/h3>\n<h4>\u203b\u5b9f\u969b\u306b\u5b9f\u884c\u3059\u308b\u3068\u304d\u306e\u8a18\u8ff0<\/h4>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'\u3010\u3000\u767a\u884c\u6307\u5b9a(ComboBox_OBJ000)\u3000\u3011\r\nCall ComboBoxInsert(Me.ComboBox_OBJ000, &quot;02&quot;)\r\n<\/pre>\n<h4>\u203b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u6301\u3063\u3066\u304f\u308b\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3<\/h4>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n'--------------------------------------------------------------------------------\r\n'\u3000ComboBox\u5185\u5bb9\u306e\u53d6\u5f97\u51e6\u7406(\u51fa\u529b\u7cfb\u9078\u629e\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9\u51e6\u7406)\r\n'--------------------------------------------------------------------------------\r\nPublic Sub ComboBoxInsert(ByVal objComboBox As System.Windows.Forms.Control, ByVal strSelectCode As String)\r\n\r\n\tDim strValues As DataTable = Nothing\r\n\tDim intA As Integer = 0\r\n\r\n\tFor intA = 1 To Len(strSelectCode)\r\n\t\t'\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\r\n\t\tstrValues = MasterDataGet(Mid(strSelectCode, intA, 1))\r\n\t\t'\u30a8\u30e9\u30fc\u51e6\u7406\r\n\t\tIf strValues.Rows.Count = 0 Then\r\n\t\t\tExit Sub\r\n\t\tEnd If\r\n\t\tDirectCast(objComboBox, ComboBox).Items.Add(strValues.Rows(0).Item(&quot;\u9805\u76eeID&quot;).ToString &amp; &quot;\uff1a&quot; &amp; strValues.Rows(0).Item(&quot;\u9805\u76ee\u5024&quot;).ToString)\r\n\tNext\r\n\r\n\t'\u521d\u671f\u5024\u306e\u8868\u793a\r\n\tDirectCast(objComboBox, ComboBox).Text = DirectCast(objComboBox, ComboBox).GetItemText(DirectCast(objComboBox, ComboBox).Items(0))\r\n\r\n    End Sub\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066DataTable\u306b\u30bb\u30c3\u30c8\u3059\u308b\u95a2\u6570\u306f\u300cMasterDataGet\u300d\u3067\u3059\u304c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u88fd\u54c1\u305d\u306e\u4ed6\u3067\u51e6\u7406\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u2193\u3053\u3093\u306a\u611f\u3058\u3067\u898b\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_5.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/onaraboo.com\/wordpress\/wp-content\/uploads\/2016\/12\/20161210_5.jpg\" alt=\"\" width=\"233\" height=\"72\" class=\"alignnone size-full wp-image-425\" \/><\/a><\/p>\n<p>\u3053\u306e\u5f8c\u306f<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"Ue0AQpB3Y0\"><p><a href=\"https:\/\/onaraboo.com\/?p=119\">Visual Basic.NET ComboBox\u306e\u5c0f\u6280\u2460<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Visual Basic.NET ComboBox\u306e\u5c0f\u6280\u2460&#8221; &#8212; \u4e0a\u306b\u306f\u4e0a\u304c\u3042\u308b\u3055\" src=\"https:\/\/onaraboo.com\/?p=119&#038;embed=true#?secret=bzr6erO3wN#?secret=Ue0AQpB3Y0\" data-secret=\"Ue0AQpB3Y0\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><br \/>\n\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u5fdc\u7528\u3057\u3066\u5236\u5fa1\u3067\u304d\u308c\u3070\u6c4e\u7528\u6027\u306e\u5411\u4e0a\u306b\u5f79\u306b\u7acb\u3064\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u696d\u52d9\u30a2\u30d7\u30ea\u3067\u4f7f\u7528\u3067\u304d\u305d\u3046\u306a\u3082\u306e\u3092\u4e94\u6708\u96e8\u306b\u8a18\u9332\u3057\u3066\u304a\u304f\u3002 \u307e\u3068\u307e\u308b\u307e\u3067\u5f85\u3063\u3066\u3044\u308b\u3068\u5fd8\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u306b\uff65\uff65\uff65\u3002\uff57\uff57 \u306a\u304a\u3001\u3053\u306e\u30d6\u30ed\u30b0\u5185\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30bd\u30fc\u30b9\u306e\u8ee2\u8f09\u30fb\u8ee2\u7528\u306b\u3064\u3044\u3066\u306f\u4f55\u3082\u7e1b\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u3054\u4f7f&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/onaraboo.com\/?p=421\">Read more<span class=\"screen-reader-text\">Visual Basic.NET \u3044\u308d\u3044\u308d\u306a\u30c6\u30af\u30cb\u30c3\u30af7<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,5,2],"tags":[],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-visual-basic-net","category-5","category-2","entry"],"_links":{"self":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=421"}],"version-history":[{"count":0,"href":"https:\/\/onaraboo.com\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions"}],"wp:attachment":[{"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onaraboo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}