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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Capítulo 6: Gráficos en <strong>Visual</strong> <strong>Basic</strong> <strong>6.0</strong> página 85If optSi = True ThenCall divisiones(10, 5)End IfEnd SubPrivate Sub hsbCA_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 IfIf optSi = True ThenCall divisiones(10, 5)End IfEnd SubPrivate Sub optD1_Click()pctBox.AutoRedraw = TruepctBox.ClspctBox.DrawWidth = 1pctBox.Line (-90, 0)-(90, 0), vbBlackpctBox.Line (0, -45)-(0, 45), vbBlackpctBox.DrawWidth = 2End SubPrivate Sub pctBox_Paint()pctBox.AutoRedraw = TruepctBox.Line (-90, 0)-(90, 0), vbBlackpctBox.Line (0, -45)-(0, 45), vbBlackpctBox.DrawWidth = 2End Sub

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

Saved successfully!

Ooh no, something went wrong!