Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - VB homework needs the help of the program. Thank you. Points can be added to the game card urgently ~
VB homework needs the help of the program. Thank you. Points can be added to the game card urgently ~
1.-

Place controls on the form: Command 1, List 1, List2, and you can place them at will.

Set the Index property of Command 1 to 0 in the properties window.

Private Sub-Form _Load ()

Dim I is long, H is single, and L is single.

List 1。 Move 0, 0, me. ScaleWidth * 0.3,Me。 Scale height

List 1。 AddItem "Chengdu"

List 1。 AddItem "Beijing"

List 1。 AddItem "Guangzhou"

List 1。 AddItem "Shanghai"

List 1。 AddItem "Tianjin"

List 1。 AddItem "Taiyuan"

List 1。 AddItem "Chongqing"

List 1。 AddItem "Shenzhen"

L = List 1。 Width + Command 1(0)。 Height * 0.5: H = Command 1(0). height

For I = 0 to 3

If I>0 then load the command 1(I): command 1(I). Visible = true

Command 1(I). Move l, h *1.1* (I+1)

then

Command 1(0). Caption = " > "

Command 1( 1). Caption = " > > "

Command 1(2). Title = "<"

Command 1(3). Title = "< <"

Listing 2. Move command 1(0). Left + Command 1(0)。 Width + Command 1(0)。 Height, 0, me. ScaleWidth * 0.3,Me。 Scale height

End joint

Private subcommand 1_Click (index is integer)

Mark s as an integer

Select case index

Case 0

S = List 1。 List index

If S>- 1 and then Listing 2. AddItem list 1. List: list 1. Remove item s

Case 1

For S = 0 to List 1. List count-1

Listing 2. AddItem list 1. tabulation/listing

then

List 1。 clear

Case 2

S = List2。 List index

If S>- 1 and then list 1. AddItem List2。 List: List 2. Remove item s

Case 3

For S = 0 to List2. List count-1

List 1。 AddItem List2。 tabulation/listing

then

Listing 2. clear

End selection

End joint

2.-

Place controls on the form: Command 1, Picture 1, and you can place them at will.

Set the Index property of Command 1 to 0 in the properties window.

Private Sub-Form _Load ()

Dim I is long, L is single, W is single, and T is single.

T = Command 1(0)。 Height * 0.5

L = Command 1(0)。 Height * 0.5: W = Command 1(0). width

For I = 0 to 2

If I>0 then load the command 1(I): command 1(I). Visible = true

Command 1(I). Move L+W * 1. 1 * I, t

then

Command 1(0). Caption = "Draw an ellipse"

Command 1 (1). Caption = "Clear"

Command 1(2). Caption = "Exit"

End joint

Private subcommand 1_Click (index is integer)

Select case index

Case 0: Call Yuan

Case 1: picture 1. Cls

Case 2: Unload me

End selection

End joint

Private dimension ()

Dim H is single, I is long.

Dim x is Single, y is Long, r is Single and e is Single.

Picture 1. AutoRedraw = True: Picture 1。 Cls

Picture 1. FillStyle = 0

H = picture 1. Scale height

For I = 1 to 50

Irregular

X = picture 1. Scale width * Rnd

y = H * Rnd

r = H * (0.0 1 + 0. 1 * Rnd)

e = 0. 1 + 2 * Rnd

Picture 1. FillColor = & ampHFFFFFF * Rnd

Picture 1. Circle (x, y), r,,, e

then

End joint

Private Sub-Form _Resize ()

Dim W means single, t means single.

T = Command 1(0)。 Top + Command 1(0)。 Height * 1.5

W = me. Scale width: H = Me. Ruler height-T

If W>0 and H>0 then draw 1. Move 0, t, w, h

End joint