Advertisement
Guest User

working progress

a guest
Aug 26th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.16 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btbcalculate.Click
  4.         Dim width As Double
  5.         Dim height As Double
  6.         width = Double.Parse(txtboxWidth.Text)
  7.         height = Double.Parse(txtboxHeight.Text)
  8.         Dim widthI As Integer
  9.         Dim heightI As Integer
  10.         widthI = Math.Ceiling(width)
  11.         heightI = Math.Ceiling(height)
  12.         lblHeight.Text = heightI
  13.         lblWidth.Text = widthI
  14.         Dim rolls As Integer
  15.         Dim rolls2 As Integer
  16.         ' adding rolls of curtains
  17.         Do While widthI > 0
  18.             widthI = widthI - 5
  19.             rolls = rolls + 1
  20.         Loop
  21.         Do While heightI > 0
  22.             heightI = heightI - 3
  23.             rolls2 = rolls2 + 1
  24.         Loop
  25.         'end of loop for rolls of curtains
  26.         If rolls2 > rolls Then
  27.             rolls = rolls2
  28.         End If
  29.         ' rolls is number of rolls
  30.         lblRolls.Text = rolls
  31.     ' these are definitely wrong
  32.         lblHeight2.Text = (lblRolls.Text - lblHeight.Text)
  33.         lblWidth2.Text = (lblRolls.Text - lblWidth.Text)
  34.     End Sub
  35. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement