{"id":1024,"date":"2022-04-21T03:21:00","date_gmt":"2022-04-21T03:21:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=1024"},"modified":"2022-04-21T03:21:00","modified_gmt":"2022-04-21T03:21:00","slug":"1024","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/04\/21\/1024\/","title":{"rendered":"\u61d2\u4eba\u8bbe\u8ba1\u8f6f\u4ef6\u56fe\u5f62\u754c\u9762\u4e4b-VBA\u5de5\u5177UI\u8bbe\u8ba1"},"content":{"rendered":"<h3>\u524d\u6bb5\u65f6\u95f4\u5728\u6253\u9020\u81ea\u5df1\u5370\u524d\u5de5\u5177\u7bb1\uff0c\u61d2\u5f97\u8bbe\u8ba1UI\u754c\u9762\uff0c\u5728\u5de5\u5177\u680f\u91cc\u4e00\u4e2a\u529f\u80fd\u6dfb\u52a0\u4e00\u4e2a\u56fe\u6807\u3002\u968f\u7740\u529f\u80fd\u539f\u6765\u8d8a\u591a\uff0c\u548c\u589e\u52a0\u7b2c\u4e09\u65b9\u529f\u80fd\uff0c\u903c\u7740\u8981\u5236\u4f5c\u8f6f\u4ef6\u56fe\u5f62\u754c\u9762\u4e86\uff0c\u4ee5\u524d <code>C\/C++<\/code> \u5199\u7684\u5de5\u5177\u5c31\u5c1d\u8bd5\u8fc7\uff0c\u6240\u4ee5\u5c31\u6309\u4ee5\u524d\u7684\u571f\u529e\u6cd5\uff0c\u4f7f\u7528\u4e00\u5f20\u56fe\u7247\u6765\u5f53\u754c\u9762\u4e86\u3002<\/h3>\n<h2>1. \u5148\u7528PS\u5236\u4f5c\u4e00\u5f20\u6392\u597d\u56fe\u6807\u7684\u56fe\u7247\uff0c\u5982\u56fe<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/04\/3681084515.webp\" alt=\"ui.webp\" title=\"ui.webp\"><\/p>\n<h2>2. \u628a\u56fe\u7247\u5bfc\u5165\u5230VBA\u7f16\u8f91\u5668\u7684\u7a97\u53e3\u4e2d\uff0c\u547d\u540d<code>UI<\/code>\uff0c\u53cc\u51fb\u56fe\u7247\u6dfb\u52a0\u4e24\u884c\u4ee3\u7801<\/h2>\n<pre><code>Private Sub UI_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)\n  MsgBox \"\u83b7\u53d6\u56fe\u6807\u5750\u6807: \" &amp; X &amp; \" , \" &amp; Y\nEnd Sub<\/code><\/pre>\n<h2>3. \u6d4b\u8bd5\u8fd9\u4e2aUI\u7a0b\u5e8f\u96cf\u5f62\uff0c\u8fd0\u884c\u540e\u70b9\u51fb\u5404\u4e2a\u56fe\u6807\uff0c\u83b7\u5f97\u56fe\u6807\u5750\u6807<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/04\/3112046391.webp\" alt=\"mouse.webp\" title=\"mouse.webp\"><\/p>\n<h2>4. \u7531\u4e8eVBA\u6570\u636e\u7ed3\u6784\u6ca1\u6709 <code>C\/C++<\/code> \u65b9\u4fbf\uff0c\u6240\u4ee5\u4f7f\u7528\u4e24\u4e2a\u6570\u7ec4\uff0c\u5206\u522b\u5b585\u5217X\u5de6\u53f3\uff0c3\u884cY\u5750\u6807<\/h2>\n<pre><code>  ' \u5b9a\u4e49\u56fe\u6807\u5750\u6807pos\n  Dim pos_x As Variant\n  Dim pos_Y As Variant\n  pos_x = Array(32, 110, 186, 265, 345)\n  pos_Y = Array(50, 135, 215)<\/code><\/pre>\n<h2>5. \u4f7f\u7528\u70b9\u51fb\u5750\u6807\u548c\u5b58\u50a8\u7684\u5750\u6807\u5dee\u503c30\u4ee5\u5185\u6765\u786e\u5b9a\u662f\u5426\u70b9\u51fb\u5230\u56fe\u6807<\/h2>\n<ul>\n<li>\n<p>\u6700\u540e\u5b8c\u6210\u4ee3\u7801\u5982\u4e0b<\/p>\n<pre><code>Private Sub UI_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)\n' \u5b9a\u4e49\u56fe\u6807\u5750\u6807pos\nDim pos_x As Variant\nDim pos_Y As Variant\npos_x = Array(32, 110, 186, 265, 345)\npos_Y = Array(50, 135, 215)\n\nIf Abs(X - pos_x(0)) &lt; 30 And Abs(Y - pos_Y(0)) &lt; 30 Then\n  \u7269\u4ef6\u89d2\u7ebf\nElseIf Abs(X - pos_x(1)) &lt; 30 And Abs(Y - pos_Y(0)) &lt; 30 Then\n  \u7ed8\u5236\u77e9\u5f62\nElseIf Abs(X - pos_x(2)) &lt; 30 And Abs(Y - pos_Y(0)) &lt; 30 Then\n  \u89d2\u7ebf\u722c\u866b\nElseIf Abs(X - pos_x(3)) &lt; 30 And Abs(Y - pos_Y(0)) &lt; 30 Then\n  \u77e9\u5f62\u62fc\u7248\nElseIf Abs(X - pos_x(4)) &lt; 30 And Abs(Y - pos_Y(0)) &lt; 30 Then\n  \u62fc\u7248\u89d2\u7ebf\nEnd If\n\nIf Abs(X - pos_x(0)) &lt; 30 And Abs(Y - pos_Y(1)) &lt; 30 Then\n  \u5c45\u4e2d\u9875\u9762\nElseIf Abs(X - pos_x(1)) &lt; 30 And Abs(Y - pos_Y(1)) &lt; 30 Then\n  \u62fc\u7248\u6807\u8bb0\nElseIf Abs(X - pos_x(2)) &lt; 30 And Abs(Y - pos_Y(1)) &lt; 30 Then\n  \u667a\u80fd\u7fa4\u7ec4\nElseIf Abs(X - pos_x(3)) &lt; 30 And Abs(Y - pos_Y(1)) &lt; 30 Then\n  CQL\u9009\u62e9\nElseIf Abs(X - pos_x(4)) &lt; 30 And Abs(Y - pos_Y(1)) &lt; 30 Then\n  \u6279\u91cf\u66ff\u6362\nEnd If\n\nIf Abs(X - pos_x(0)) &lt; 30 And Abs(Y - pos_Y(2)) &lt; 30 Then\n  \u5c3a\u5bf8\u53d6\u6574\nElseIf Abs(X - pos_x(1)) &lt; 30 And Abs(Y - pos_Y(2)) &lt; 30 Then\n  Dim r As Long\nElseIf Abs(X - pos_x(2)) &lt; 30 And Abs(Y - pos_Y(2)) &lt; 30 Then\n  WebHelp\nElseIf Abs(X - pos_x(3)) &lt; 30 And Abs(Y - pos_Y(2)) &lt; 30 Then\n  WebHelp\nElseIf Abs(X - pos_x(4)) &lt; 30 And Abs(Y - pos_Y(2)) &lt; 30 Then\n  WebHelp\nEnd If\n\nEnd Sub<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\u5728\u6253\u9020\u81ea\u5df1\u5370\u524d\u5de5\u5177\u7bb1\uff0c\u61d2\u5f97\u8bbe\u8ba1UI\u754c\u9762\uff0c\u5728\u5de5\u5177\u680f\u91cc\u4e00\u4e2a\u529f\u80fd\u6dfb\u52a0\u4e00\u4e2a\u56fe\u6807\u3002\u968f\u7740\u529f\u80fd\u539f\u6765\u8d8a\u591a\uff0c\u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12],"tags":[67],"class_list":["post-1024","post","type-post","status-publish","format-standard","hentry","category-soft","category-learn","tag-vba"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=1024"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1024\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}