{"id":288,"date":"2014-10-07T08:37:00","date_gmt":"2014-10-07T00:37:00","guid":{"rendered":"http:\/\/www.ilezhizhe.com\/?p=288"},"modified":"2016-09-09T14:36:14","modified_gmt":"2016-09-09T06:36:14","slug":"vb-net-%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"http:\/\/www.ilezhi.cn\/?p=288","title":{"rendered":"VB.NET \u5b66\u4e60\u7b14\u8bb0"},"content":{"rendered":"<figure style=\"width: 464px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/ilezhizhe.qiniudn.com\/VisualStudio.jpg\" alt=\"Visual Studio LOGO\" width=\"464\" height=\"158\" \/><figcaption class=\"wp-caption-text\">Visual Studio LOGO<\/figcaption><\/figure>\n<p>&#8216;\u6570\u7ec4\u76f8\u5173<br \/>\ndim \u6570\u7ec4\u957f\u5ea6 as integer=12<br \/>\ndim \u6570\u7ec4(\u6570\u7ec4\u957f\u5ea6-1) as byte() &#8216;\u6570\u7ec4\u957f\u5ea6-1\uff1a\u4e3a\u6570\u7ec4\u4e0b\u6807\u6700\u5927\u503c<br \/>\nmsgbox(\u6570\u7ec4.length) &#8217;12<\/p>\n<p>&#8216;\u5982\u4f55\u8ba9\u6587\u672c\u6846\u81ea\u52a8\u6eda\u52a8<br \/>\ntextbox1.appendtext(&#8220;test&#8221;)<br \/>\ntextbox1.scrolltocaret()<\/p>\n<p>&#8216;\u8ba9listviewItem\u53ef\u89c1<br \/>\nListview.FindItemWithText(&#8220;test&#8221;).EnsureVisible()<\/p>\n<p>&#8216;\u9f20\u6807\u5750\u6807<br \/>\nSystem.Windows.Forms.Cursor.Position<br \/>\nControl.MousePosition<\/p>\n<blockquote><p>\u2018\u6743\u9650<br \/>\nImports System.Security.Principal<\/p>\n<p>Module \u6743\u9650<br \/>\nPublic Function \u662f\u5426\u4e3a\u7ba1\u7406\u5458()<br \/>\nDim identity As WindowsIdentity = WindowsIdentity.GetCurrent()<br \/>\nDim principal As WindowsPrincipal = New WindowsPrincipal(identity)<br \/>\nReturn principal.IsInRole(WindowsBuiltInRole.Administrator)<br \/>\nEnd Function<br \/>\nEnd Module<\/p><\/blockquote>\n<p>\u9650\u5236 DataGridView \u67d0\u5217\u53ea\u80fd\u8f93\u5165\u6570\u5b57\uff08<a href=\"http:\/\/qs52.blog.163.com\/blog\/static\/2101515920108693550413\/\">\u53c2\u8003\u8fd9\u91cc<\/a>\uff09<\/p>\n<pre class=\"lang:vbnet decode:true \"> Private Sub TextBoxDec_KeyPress(sender As Object, e As KeyPressEventArgs)\r\n        If e.KeyChar &lt;&gt; \"8\" And Not Char.IsDigit(e.KeyChar) And e.KeyChar &lt;&gt; \".\" Then\r\n            e.Handled = True\r\n        End If\r\n    End Sub\r\n    Private Sub DataGridView1_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing\r\n        Dim columnIndex As Integer = 4\r\n        If DataGridView1.CurrentCell.ColumnIndex = columnIndex Then\r\n            AddHandler e.Control.KeyPress, AddressOf TextBoxDec_KeyPress\r\n        Else\r\n            RemoveHandler e.Control.KeyPress, AddressOf TextBoxDec_KeyPress\r\n        End If\r\n\r\n        Me.Text = DataGridView1.CurrentCell.ColumnIndex.ToString\r\n    End Sub\r\n\r\n    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load\r\n        DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter\r\n    End Sub<\/pre>\n<p>\u83b7\u53d6\u5f53\u524d\u7a0b\u5e8f\u8def\u5f84\u53ca\u7a0b\u5e8f\u540d<br \/>\nApplication.ExecutablePath<\/p>\n<p>\u83b7\u53d6\u7a0b\u5e8f\u542f\u52a8\u53c2\u6570\uff08\u6ce8\uff1a\u53c2\u6570\u524d\u540e\u6709\u53cc\u5f15\u53f7\uff09<br \/>\ndim para as String=Microsoft.VisualBasic.Command<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8216;\u6570\u7ec4\u76f8\u5173 dim \u6570\u7ec4\u957f\u5ea6 as integer=12 dim \u6570\u7ec4(\u6570\u7ec4\u957f\u5ea6-1) as by &hellip; <a href=\"http:\/\/www.ilezhi.cn\/?p=288\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">VB.NET \u5b66\u4e60\u7b14\u8bb0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4,3],"tags":[24,100,65],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-share","category-original","category-program","tag-vb-net","tag-100","tag-65"],"_links":{"self":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":0,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ilezhi.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}