Advertisement
2_2002-2004 Custom Controls/ Forms/ Menus #122180

design

Creates a pretty neat geometric design!

AI

ИИ-обзор: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Исходный код
original-source
' Before you start anything you should create: 1 picturebox, 1 textbox, 1 command button. Size the picture box so it is pretty big in size and it should be EXACTLY squared so the design looks nice! To do so make sure the scalewidth and scaleheight in the properties section are equal to each other. Now put the following code into the command button.
Private Sub Command1_Click()
If Text1 <= 0 Then Exit Sub
Picture1.Cls
w = Picture1.ScaleWidth / Text1
h = Picture1.ScaleHeight / Text1
' top to left
For draw = 0 To Text1
  Picture1.Line (0 + (w * draw), 0)-(0, Picture1.ScaleHeight - (h * draw))
Next draw
' left to bottom
For draw = 0 To Text1
  Picture1.Line (0, 0 + (h * draw))-(0 + (w * draw), Picture1.ScaleHeight)
Next draw
' bottom to right
For draw = 0 To Text1
  Picture1.Line (0 + (w * draw), Picture1.ScaleHeight)-(Picture1.ScaleWidth, Picture1.ScaleHeight - (h * draw))
Next draw
' right to top
For draw = 0 To Text1
  Picture1.Line (Picture1.ScaleWidth, 0 + (h * draw))-(0 + (w * draw), 0)
Next draw
End Sub
Оригинальные комментарии (3)
Восстановлено из Wayback Machine