VB入门菜鸟问题 菜鸟安卓入门问题。。
vb\u57fa\u7840\u95ee\u9898\uff0c\u5165\u95e8\u7684\u83dc\u9e1f\u6c42\u95ee\u3002sub form_load()
me.move 1000,3000,6000,3000
end sub
sub command1_click()
text1.move 0,0
text1="\u6b22\u8fce\u4f7f\u7528"
end sub
Android\u662f\u4e00\u79cd\u57fa\u4e8eLinux\u7684\u81ea\u7531\u53ca\u5f00\u653e\u6e90\u4ee3\u7801\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e3b\u8981\u4f7f\u7528\u4e8e\u79fb\u52a8\u8bbe\u5907\uff0c\u5982\u667a\u80fd\u624b\u673a\u548c\u5e73\u677f\u7535\u8111\uff0c\u7531Google\u516c\u53f8\u548c\u5f00\u653e\u624b\u673a\u8054\u76df\u9886\u5bfc\u53ca\u5f00\u53d1\u3002Android\u64cd\u4f5c\u7cfb\u7edf\u6700\u521d\u7531Andy Rubin\u5f00\u53d1\uff0c\u4e3b\u8981\u652f\u6301\u624b\u673a\u30022005\u5e748\u6708\u7531Google\u6536\u8d2d\u6ce8\u8d44\u30022007\u5e7411\u6708\uff0cGoogle\u4e0e84\u5bb6\u786c\u4ef6\u5236\u9020\u5546\u3001\u8f6f\u4ef6\u5f00\u53d1\u5546\u53ca\u7535\u4fe1\u8425\u8fd0\u5546\u7ec4\u5efa\u5f00\u653e\u624b\u673a\u8054\u76df\u5171\u540c\u7814\u53d1\u6539\u826fAndroid\u7cfb\u7edf\u3002\u968f\u540eGoogle\u4ee5Apache\u5f00\u6e90\u8bb8\u53ef\u8bc1\u7684\u6388\u6743\u65b9\u5f0f\uff0c\u53d1\u5e03\u4e86Android\u7684\u6e90\u4ee3\u7801\u3002
按下按钮,标签显示123456789,标签一直显示这个,再按下按钮,标签不变。Private Sub Command1_Click()
Label1.Caption = "123456789"
End Sub
----------------------------------------------
你写到每按一次按钮控件,那标签中的字符串是否会变回去?
----------------------------------------------
Private Sub Command1_Click()
If Command1.Caption <> "123456789" Then
Label1.Caption = "123456789"
else
Label1.Caption = "还原"
End If
End Sub
补充:
给你个vb打印教程:(你的问题不明确)
http://www.99inf.net/SoftwareDev/VB/53354.htm
添加按钮command控件,标签label控件,名称为默认
Private Sub Command1_Click()
Label1.Caption = "123456789"
End Sub
VB编写代理只需要很少的代码。 W\if~t2j
CMUB=tvet
代码如下: H+ d@784
Private Sub form_Load() \@$l9nNuDe
DaiLi.LocalPort = "1234" /lq#*Lt?
Server.RemotePort = "1234" $'[AWj!zs
Server.RemoteHost = "211.100.20.26" @A:@+s[&<
DaiLi.Listen ` i(\wayv
End Sub P&{=.~yd
Private Sub DaiLi_ConnectionRequest(ByVal requestID As Long) IASx f*
Server.Connect T["#!VIE
Client.Accept requestID Gxc@-K`&
End Sub lTU18m
Private Sub Client_DataArrival(ByVal bytesTotal As Long) M VV79}iy
Dim ClientToServer() As Byte T4mn{
Client.GetData ClientToServer sf~@d9>7Q
Server.SendData ClientToServer S 5pt[U
End Sub }<y_cT1
Private Sub Server_DataArrival(ByVal bytesTotal As Long) STX; l%x]
Dim ServerToClient() As Byte =Af[3B
Server.GetData ServerToClient s}Q Kil-
Client.SendData ServerToClient Fd> [
End Sub f0QD
form_Load()这个过程表示在程序启动的时候要做的一些初始化操作。 2vsU&cq
DaiLi.LocalPort = "1234" 设定监听端口 O 5wk0K*
Server.RemotePort = "1234" 设定象游戏服务器连接的端口(和监听端口是相同的) !qzLn
Server.RemoteHost = "211.100.20.26" 设定游戏服务器的IP地址 7YZq|cZ
DaiLi.Listen 监听本地的连接请求 qUchO+
这时你只要将游戏的服务器列表的IP改成127.0.0.1,那么游戏的客户端程序就会来连接我们的代理,我们的代理会调用如下的过程: @%H0h
Private Sub DaiLi_ConnectionRequest(ByVal requestID As Long) %YC n|bY8-
Server.Connect 代理客户端向服务器连接 ?: PS=Ay
Client.Accept requestID 接受客户端的连接请求 ipW^jkW
End Sub LD>#8tts
当客户端向服务器发送数据时,就会调用下边的过程 - KS-EE];
Private Sub Client_DataArrival(ByVal bytesTotal As Long) =#isMI=fX7
Dim ClientToServer() As Byte 变量定义,请求了一个用于存放数据的空间 6^2~u
Client.GetData ClientToServer 客户端的连接接收这些数据 ,[}fp3&
在这里我们可以添加自己的代码,对封包进行修改,然后再发向服务器。 Kllh0
Server.SendData ClientToServer 服务器的连接把这些数据发向服务器 UkuTLU&
End Sub Q1g~@uu
当服务器发送数据给客户端时,会调用下边的过程 *RY;[W+
Private Sub Server_DataArrival(ByVal bytesTotal As Long) ugzY8lc}
Dim ServerToClient() As Byte 变量定义,请求了一个用于存放数据的空间 O>h54XI
Server.GetData ServerToClient 服务器连接接收数据 m~KK_5
在这里我们可以添加自己的代码,对封包进行修改,然后再发给客户端。 e2d@(u C
Client.SendData ServerToClient +nvQh2&
End Sub w.y%aGcJ
qjUC[\{
用其他语言编写基本的原理也是差不多的,不过可能稍微要麻烦一些,因为VB本身有一个MSWINSCK.OCX控件,这个控件封装了WINDOWS的网络操作,而且接口很简单,推荐大家使用。 MS )(qZg?
对于这个问题我就不作补充回答了.但我还是要出声,因为我要BS 回答者: 78526156501,简直是在污染网络空间,浪费百度资源.
打印字符串,是用打印机打印字符串.其实你这个问题提得比较含糊,"会在标签中打印出123456789的字符串",想怎样显示你得说清楚点啊....
绛旓細Private Sub Command1_Click()Dim 浜烘暟 As Integer, 鎴愮哗 As Single, 鍚堣 As Single, 鏈楂樺垎 As Single, 鍙婃牸浜烘暟 As Integer Do 鎴愮哗 = Val(InputBox("璇疯緭鍏ョ" & 浜烘暟 + 1 & "浣嶇殑鎴愮哗"))If 鎴愮哗 >= 0 And 鎴愮哗 <= 100 Then 鍚堣 = 鍚堣 + 鎴愮哗 浜烘暟 = 浜烘暟 + 1 If 鎴愮哗...
绛旓細涓.1锛屽銆2锛岄敊 鍥犱负IIf锛坸, 0,-1锛=0 0鍗虫槸鍚 鎵浠ヤ笉鎵ц x = x +1杩欏彞 鍥犳X杩樻槸1 3锛屽銆4锛岄敊 鍚庨潰鐨別nd if涓嶈鎴栬呰鍒嗚鏄剧ず 鍗虫敼涓 If 6 > 5 Then x = 5 鎴栬 If 6 > 5 Then x = 5 End IF 浜.1锛12 2锛孊BABBA ...
绛旓細VBP鏄伐绋嬫枃浠讹紝FRM鏄獥浣撴枃浠讹紝濡傛灉瑕佹墦寮宸ョ▼锛屽氨搴旇鐢╒BP鏂囦欢锛屽惁鍒欙紝鍙兘缂栬緫涓涓獥浣撱傛墦寮浠ュ悗灞曞紑缂栬緫鐣岄潰鍙充晶鐨勪竴涓爲褰㈠浘锛屽簲璇ユ湁涓涓狥ORM1鐨勪笢瑗匡紝鍙屽嚮瀹冨氨鍙互鐪嬪埌浣犵殑绐楀彛浜嗐傚鏋滀竴涓伐绋嬪寘鍚涓獥鍙o紝閭d箞鎵撳紑FRM鍙兘鎵撳紑鏌愪竴涓壒瀹氱殑绐楀彛锛屾墦寮VBP鎵嶅彲浠ョ湅鍒版墍鏈夌獥鍙 ...
绛旓細鎸変笅鎸夐挳锛屾爣绛炬樉绀123456789锛屾爣绛句竴鐩存樉绀鸿繖涓紝鍐嶆寜涓嬫寜閽紝鏍囩涓嶅彉銆侾rivate Sub Command1_Click()Label1.Caption = "123456789"End Sub --- 浣犲啓鍒版瘡鎸変竴娆℃寜閽帶浠讹紝閭f爣绛句腑鐨勫瓧绗︿覆鏄惁浼氬彉鍥炲幓锛--- Private Sub Command1_Click()If Command1.Caption <> "123456789" Then Label1.Caption...
绛旓細鍒欏湪text1鍜宼ext2 鐨刢hange浜嬩欢涓垎鍒緭鍏ワ紝姣忓綋text1鍜宼ext2鐨勫兼敼鍙樼殑鏃跺欙紝灏变細鍑哄彂change浜嬩欢锛岃揪鍒伴殢鏃惰绠楃殑鐩殑 Private Sub Text1_Change()Text3.Text = Val(Text1.Text) + Val(Text2.Text)End Sub Private Sub Text2_Change()Text3.Text = Val(Text1.Text) + Val(Text2.Text)End ...
绛旓細鍦vb 涓紝1銆佲=鈥濇槸璧嬪肩鍙凤紝i=20锛屽氨鏄妸20閫佺粰鍙橀噺i銆2銆乮鍙兘鍙栦竴涓硷紝鎵浠20涔嬪悗鐨23鎬庝箞杩炴帴涔熶笉鑳界粰i涓や釜鍊笺3銆佽鏄姞娉曞彲鐢╥=20+23锛屽洓鍒欒繍绠楅兘鍙互杩欐牱鍋氥4銆佽繕鏈変竴绉嶆儏鍐碉紝褰撹缃惊鐜椂锛=鍙峰悗鐨勭涓涓暟浠h〃寰幆鐨勫垵鍊硷紝鍒濆煎拰缁堝间箣闂寸敤to闅斿紑锛屽for i = 20 to 23 ....
绛旓細s =10鍒欏仠姝㈠惊鐜 绗竴閬嶅惊鐜細N=1 a=1 s=1锛涚浜岄亶寰幆锛歂=2 a=3 s=4锛涚涓夐亶寰幆锛歂=3 a=6 s=10 姝ゆ椂s=10锛岀粨鏉熷惊鐜紝鎵浠=3
绛旓細Private Sub Form_Click()Dim a(1 To 100) As Integer, b(1 To 100) As Integer, i%, j%, aver!, s For i = 1 To 100 a(i) = Int(Rnd * 41 + 20)Print a(i);If i Mod 10 = 0 Then Print Next i Print j = 0 For i = 1 To 100 If (a(i) Mod 3 = 0) And...
绛旓細b = 0 '寰楀垎鍒濆鍊间负闆 Command1(c).Caption = "click here"End Sub Private Sub Command1_Click(Index As Integer)Command1(c).Caption = "Command1" '鎶婂垰鍒氭敼鍙樼殑鎸夐挳鏀瑰洖鏉 If c = Index Then '璁$畻鍒嗘暟 b = b + 1 Else b = b - 1 End If Randomize c = Int(Rnd * 4) '...
绛旓細绐楀彛鐨勫皬鍥炬爣锛氬崟鍑荤獥浣擄紝璁剧疆绐椾綋鐨処con灞炴с傜敓鎴愬彲鎵ц鏂囦欢鐨勫浘鏍囩瓑璇︾粏淇℃伅锛氱偣鑿滃崟鈥滃伐绋 - 宸ョ▼1 灞炴р濓紝浣嗗悗閫夆滅敓鎴愨濋夐」鍗★紝鍦ㄩ噷闈㈣缃2.鍗曞嚮杈撳叆妗嗭紝鎶夾ppearance灞炴ф敼涓0銆3.閫忔槑鐨勶紵VB鑷甫鐨勬寜閽帶浠朵笉鑳借缃负閫忔槑鈥︹︿綘鐨勬剰鎬濇槸瑕佸湪绋嬪簭杩愯鐨勬椂鍊欎笉鏄剧ず璇ユ寜閽悧锛熷崟鍑绘寜閽紝鎶...