vb复选框问题 vb复选框的问题
vb.net checkbox\u4f7f\u7528\u7684\u95ee\u9898\u6bd4\u5982\u8981\u659c\u4f53\uff0c\u53ef\u4ee5\u5728Checkbox2\u7684CheckedChanged\u91cc\u5199
If CheckBox2.Checked = True Then zFontstyle = zFontstyle + FontStyle.Italic '\u9009\u4e2d\u65f6 Else zFontstyle = zFontstyle - FontStyle.Italic '\u672a\u9009\u4e2d\u65f6 End If \u5176\u4ed6\u4e5f\u7c7b\u4f3c
\u9009\u4e2d\u65f6\u5728\u539f\u6709\u7684Font.Style\u4e0a\u52a0\u4e0a\u679a\u4e3e\u503c
\u53bb\u9664\u65f6\u5728\u539f\u6709\u7684Font.Style\u4e0a\u51cf\u53bb\u679a\u4e3e\u503c
text1.text = ""if check1.value=1 thentext1.text=text1.text & check1.captionend ifif check2.value=1 thentext1.text=text1.text & check2.captionend ifif check3.value=1 thentext1.text=text1.text & check3.captionend ifif check4.value=1 thentext1.text=text1.text & check4.captionend if
dim strResult as stringstrResult="我的爱好是"if ch1.value=checked then strResult = strResult & ch1.captionif ch2.value=checked then strResult = strResult & ch1.captionif ch3.value=checked then strResult = strResult & ch1.captionform1.print strResultOption Base 1
Private Sub Command1_Click()
Dim x, z
Dim y(3)
x = Array(Check1.Value = 1, Check2.Value = 1, Check3.Value = 1)
z = Array("体育", "音乐", "美术")
Print "我的爱好是";
For i = 1 To 3
y(i) = z(i)
If x(i) = True Then
Print z(i);
End If
Next iEnd Sub
Private Sub C1_Click()
Dim r As String
If Ch1.Value=1 Then r=Ch1.Caption
If Ch2.Value=1 Then r =r & Ch2.Caption
If Ch3.Value=1 Then r =r & Ch3.Caption
Msgbox "我的爱好是" & r ,vbOkOnly
End Sub
绛旓細1銆佸崟鍑烩濋夋嫨绐楁牸鈥滄寜閽紝濡傚浘鎵绀恒2銆侀変腑绗竴涓璞★紝鎸変綇銆怱hift銆戦敭锛屽崟鍑绘渶鍚庝竴涓璞★紝鍏ㄩ夋墍鏈夋帶浠讹紝濡傚浘鎵绀恒3銆佸崟鍑烩濆睘鎬р滄寜閽紝璁剧疆Value椤圭殑鍊间负False锛屽鍥炬墍绀猴紝鍙栨秷鎵鏈夊璞$殑鍕鹃夈傝缃澶嶉夋鏉ョ粺涓闇瑕佸叾瀹冨閫夋鐨勫硷紝瑕佺敤鍒癡BA缂栫▼锛岃繃绋嬪氨鐩稿澶嶆潅涓浜涖
绛旓細vbnet澶嶉夋涓嶈兘涓虹┖鏄洜涓哄湪绋嬪簭涓缃簡鏍¢獙閫昏緫锛屽鏋滅敤鎴锋病鏈夊嬀閫夊閫夋锛屽垯浼氭彁绀虹敤鎴疯繘琛屽嬀閫夈傛牴鎹煡璇㈢浉鍏冲叕寮淇℃伅鏄剧ず锛屽湪VB.NET涓紝澶嶉夋锛圕heckBox锛夋帶浠跺彲浠ヨ璁剧疆涓哄繀濉」锛屼篃灏辨槸蹇呴』鍕鹃夋墠鑳借繘琛屼笅涓姝ユ搷浣滐紝鍚﹀垯闇瑕佺粰鍑烘彁绀轰俊鎭傝繖鏍峰彲浠ョ‘淇濈敤鎴疯緭鍏ョ殑鏁版嵁绗﹀悎棰勬湡鐨勮姹傦紝閬垮厤浜嗙▼...
绛旓細Check1.Value = 0杩欎釜鍙ュ瓙鏀瑰彉浜澶嶉夋鐨勫硷紝鍙兘浼氬鑷村閫夋鍙戠敓涓娆lick浜嬩欢銆傚拰榧犳爣鍐嶇偣浜嗕竴娆℃槸涓鏍风殑鏁堟灉銆傝ˉ鍏咃細鐢变簬绗竴娆℃妸鍊兼敼涓0浜嗭紝鎵浠ュ悗闈heck1.Value = 0 涓嶄細鏀瑰彉鍊硷紝鎵浠ヤ笉浼氬啀娆″紩鍙戠殑click浜嬩欢锛屼篃灏变笉浼氭寰幆銆
绛旓細dim strResult as stringstrResult="鎴戠殑鐖卞ソ鏄"if ch1.value=checked then strResult = strResult & ch1.captionif ch2.value=checked then strResult = strResult & ch1.captionif ch3.value=checked then strResult = strResult & ch1.captionform1.print strResult ...
绛旓細Private Sub Check2_Click() '鏂滀綋澶嶉夋寜閽 If Check2.Value = 0 Then Label1.FontItalic = False Else Label1.FontItalic = True End If End Sub Private Sub Check3_Click() '涓嬪垝绾澶嶉夋 If Check3.Value = 0 Then Label1.FontUnderline = False Else Label1.FontUnderline ...
绛旓細浣跨敤鎺т欢鏁扮粍 Private Sub Check1_Click(Index As Integer)Dim i As Integer Dim tmpstr As String For i = 0 To Check1.UBound tmpstr = tmpstr & CStr(Check1(i).Value)Next Text1.Text = tmpstr End Sub Private Sub Form_Load()Dim i As Integer Check1(0).Caption = ""Check1(...
绛旓細Private Sub Command2_Click() For i = 1 To ListView1.ListItems.Count ListView1.ListItems.Item(i).Checked = False NextEnd SubPrivate Sub Command1_Click() For i = 1 To ListView1.ListItems.Count ListView1.ListItems.Item(i).Checked = True NextEnd SubPrivate S...
绛旓細ts(1) = "56789"ts(2) = ""'娣诲姞涓涓垽鏂敤鐨勫彉閲忥細Dim bToDelete As Boolean For i = List1.ListCount - 1 To 0 Step -1 bToDelete = False '鍒濆涓篺alse tn(0) = 0 '姣忔寰幆瑕佸垵濮嬪寲涓娆★紝涓嶇劧濡傛灉閮戒笉鍕鹃夌殑鐢诲氨鍙兘浼氬嚭闂 tn(1) = 0 tn(2) = 3 '鍒嗕袱娆¤繘琛...
绛旓細check1.caption="鍏ㄩ"濡傛灉浣犲垎鍒敤涓や釜澶嶉夋鎺у埗鍏ㄦ竻鍜屽叏閫夛紝浠g爜濡備笅 === 鍏堢敾涓や釜澶嶉夋锛宑heck1涓哄叏閫夛紝澶嶅埗n涓猚heck2锛屼竴鍏卞氨鏈塶+1涓猚heck2锛屽啀鐢讳竴涓猚heck3锛堝叏娓咃級=== Private Sub Check1_click()If Check1.Value = 1 Then For i = 0 To n Check2(i).Value = Check1.Val...
绛旓細1銆佹墦寮VB杞欢锛屽湪绐椾綋涓婇潰娣诲姞涓涓枃鏈銆2銆佺偣鍑绘枃鏈锛屽湪鍙充晶鐨勫睘鎬х獥鍙d腑锛岃缃悕绉板拰鏁板硷紝灏嗘枃鏈唴瀹规竻绌恒3銆佸湪绐椾綋涓婇潰锛屽啀娣诲姞涓涓按骞虫粴鍔ㄦ潯銆4銆佺偣鍑绘按骞虫粴鍔ㄦ潯锛岃缃悕绉板拰鏁板硷紝灏哅in璁剧疆涓0,Max璁剧疆涓100銆傦紙鏂囨湰妗嗕腑鐨勮緭鍏ョ殑鏁拌寖鍥翠负0-100锛夈傚皢largechange璁剧疆涓5锛孲mallchange璁剧疆涓...