Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

rx7man

@rx7man
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • i need help with a vb project anything helps! :)
    R rx7man

    Eddy is right in the foreach, but for recalculation, I'd have a handler that handles the on change event from each of the boxes, it can all be done in one subroutine

    'kinda like this
    private sub TextboxChanged(sender as object, e as eventargs) handles txtRoomWidth.changed, txtRoomLength.changed, lstFlooringType.changed

    dim SquareFootage as single = txtRoomWidth.value * txtRoomLength.value
    dim CostPerFoot as single 'Insert code here to get the cost per square foot of the current flooring type

    dim RoomCost as single = Squarefootage * CostPerFoot

    'put code here to insert the cost into the list of costs

    dim totalprice as single = 0

    foreach RoomPrice as single in RoomPriceList
        totalprice += RoomPrice
    next
    

    txtTotalprice.value = "Total cost is $" & totalprice

    end sub

    I'd have used the names you used, but I can't open both windows at once

    Visual Basic business help

  • goto statement
    R rx7man

    OK, from a relative novice, here's the way I see it, and pardon me, but I come from a Qbasic/VB background. As for multiple returns, if you have 10 conditions, lets say in a "Select case" statement, I see it OK to use multiple returns... if you have returns scattered, then I can see a problem. I find the following a neat way of doing this... I'm usually not much for the ":", but again I find that on something simple like this, putting the condition and the return value on the same line improves readability

    Select case i
    case 1 : return false
    case 2 : return true
    case 3 : return false
    end select

    The Lounge csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups