1樓:匿名使用者
把以下**用記事本儲存為字尾名為.frm的檔案中,用vb開啟。
******************************====
version 5.00
begin vb.form form1
caption = "form1"
clientheight = 3195
clientleft = 60
clienttop = 345
clientwidth = 4680
linktopic = "form1"
scaleheight = 3195
scalewidth = 4680
startupposition = 3 '視窗預設
begin vb.***mandbutton ***mand3
caption = "***mand3"
height = 375
left = 1920
tabindex = 4
top = 1920
width = 855
endbegin vb.***mandbutton ***mand2
caption = "***mand2"
height = 375
left = 1920
tabindex = 3
top = 1200
width = 855
endbegin vb.***mandbutton ***mand1
caption = "***mand1"
height = 375
left = 1920
tabindex = 2
top = 480
width = 855
endbegin vb.listbox list2
height = 2400
left = 2880
tabindex = 1
top = 360
width = 1815
endbegin vb.listbox list1
height = 2400
left = 120
tabindex = 0
top = 360
width = 1695
endend
attribute vb_name = "form1"
attribute vb_globalnamespace = false
attribute vb_creatable = false
attribute vb_predeclaredid = true
attribute vb_exposed = false
function isprime(byval n as long) as boolean
dim i as long
for i = 2 to int(n / 2)
if n mod i = 0 then isprime = false: exit function
next
isprime = true
end function
private sub ***mand2_click()
dim i as integer
redim a(0) as integer
for i = 0 to 29
if isprime(list1.list(i)) then
a(ubound(a)) = list1.list(i)
list2.additem a(ubound(a))
redim preserve a(ubound(a) + 1)
end if
next
***mand1.enabled = true
***mand2.enabled = false
end sub
private sub ***mand3_click()
endend sub
private sub form_load()
***mand1.caption = "排序"
***mand2.caption = "篩選"
***mand3.caption = "退出"
***mand1.enabled = false
randomize
dim i as integer
for i = 1 to 30
list1.additem int(rnd * 1900 + 100)
next
end sub
求用vb設計乙個關於字型字型大小的程式?
2樓:匿名使用者
新增如下**:
private sub check1_click()
text1.fontunderline = not text1.fontunderline
end sub
private sub check2_click()
text1.fontitalic = not text1.fontitalic
end sub
private sub check3_click()
text1.fontbold = not text1.fontbold
end sub
private sub option1_click()
text1.fontname = "黑體"
end sub
private sub option2_click()
text1.fontname = "楷體_gb2312"
end sub
private sub option3_click()
text1.fontname = "隸書" '我的電腦沒有隸書字型,所以除錯時出錯
end sub
private sub option4_click()
text1.fontsize = 12
end sub
private sub option5_click()
text1.fontsize = 16
end sub
private sub option6_click()
text1.fontsize = 20
end sub
用vb編制乙個設定文字字型的程式怎麼設定?主要用到的工具箱裡的哪些東西?
3樓:匿名使用者
用vb編制乙個設定文字字型
的程式主要用到的工具箱裡的optionbutton 控制項對顯示字型文字控制項的fnot屬性進行設定。用***bobox 控制項或listbox控制項設定顯示字型及它的尺寸。
optionbutton 控制項,optionbutton 控制項顯示乙個可以開啟或者關閉的選項。
***bobox 控制項,組合框控制項將文字框和列表框的功能結合在一起。有了這個控制項,使用者可通過在組合框中輸入文本來選定專案,也可從列表中選定專案。
組合框的樣式
此處有三種組合框樣式。每種樣式都可在設計時或執行時來設定,而且每種樣式都使用數值或相應的 visual basic
常數來設定組合框的樣式。
font 屬性,返回乙個 font 物件。
為了標識乙個具體的要使用其屬性的 font 物件應使用乙個物件的 font 屬性。例如,下面的**將改變乙個 font
物件的 bold 屬性設定,該font 物件被 textbox 物件的 font
屬性所標識:
txtfirstname.font.bold = true
4樓:匿名使用者
private sub ***bo1_click()text1.fontname = ***bo1.textend sub
private sub ***bo2_click()text1.fontsize = val(***bo2.text)end sub
private sub form_load()***bo1.additem "宋體"
***bo1.additem "黑體"
***bo1.additem "楷體_gb2312"
***bo1.text = "宋體"
for i = 12 to 72 step 2***bo2.additem str(i)next i
***bo2.text = "12"
end sub
vb程式設計題,vb程式設計題目
dim a 1 to 80 as integer dim js as integer dim os as integer private sub command1 click dim i,j,k randomize j 0 text1.text for i 1 to 80 a i int rnd 9...
急求vb程式設計題答案,急求VB程式設計題答案
private sub command1 click dim i as integer text1.text list1.list 0 for i 0 to 9 if val list1.list i val text1.text then text1.text list1.list i next ...
一道VB程式設計題目,求大佬解答,一道vb程式設計題目求大佬解答!!!
private sub mand1 click dim i as integer for i 11 to 999 if i strreverse i and i 2 strreverse i 2 and i 3 strreverse i 3 then print i,i 2,i 3end if ne...