12.07.2015 Views

Visual Basic 6.0 - Tecnun

Visual Basic 6.0 - Tecnun

Visual Basic 6.0 - Tecnun

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ESIISS: Aprenda <strong>Visual</strong> <strong>Basic</strong> <strong>6.0</strong> como si estuviera en Primero página 84Option ExplicitDim a, b, c As DoubleDim x1, x2, dis, xr, xi As DoublePrivate Sub divisiones(nx As Integer, ny As Integer)Dim i As IntegerDim x, xinc, y, yinc As SinglepctBox.DrawWidth = 1xinc = 20 / (nx - 1)x = -10For i = 1 To nxpctBox.Line (x, 0)-(x, -1)x = x + xincNext iyinc = 10 / (ny - 1)y = -5For i = 1 To nypctBox.Line (-1, y)-(0, y)y = y + yincNext ipctBox.DrawWidth = 2End SubPrivate Sub cmdSalir_Click()EndEnd SubPrivate Sub Form_Load()pctBox.Scale (-10, 5)-(10, -5)End SubPrivate Sub hsbBA_Change()a = 1b = hsbBA.Value / 10#c = hsbCA.Value / 10#lblBA.Caption = blblCA.Caption = cdis = b ^ 2 - 4 * a * cIf optD2.Value = True Then ’mantenerpctBox.AutoRedraw = TrueElse’borrarpctBox.AutoRedraw = FalsepctBox.ClsEnd IfIf dis > 0 Thenx1 = (-b + Sqr(dis)) / (2 * a)x2 = (-b - Sqr(dis)) / (2 * a)lblX1.Caption = Format(x1, "###0.000")lblX2.Caption = Format(x2, "###0.000")pctBox.PSet (x1, 0), vbRedpctBox.PSet (x2, 0), vbRedElseIf dis = 0 Thenx1 = -b / (2 * a)x2 = x1lblX1.Caption = Format(x1, "###0.000")lblX2.Caption = ""pctBox.PSet (x1, 0), vbGreenElsexr = -b / (2 * a)xi = Sqr(-dis) / (2 * a)lblX1.Caption = Format(xr, "###0.000")lblX2.Caption = Format(xi, "###0.000")pctBox.PSet (xr, xi), vbBluepctBox.PSet (xr, -xi), vbBlueEnd If

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!