Results 1 to 5 of 5

Thread: very newbie question, with numeric up/down

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2003
    Posts
    55

    very newbie question, with numeric up/down

    hey, well i want the value of the numericupdown (extracost) to be "1.50" so i did

    VB Code:
    1. ext.value = "1.50"

    im using this in conjunction with a listbox so if a item in the listbox is 3 it will add the ext to the total to make it 4.50 if the numeric box is set to 1 and if set to 2 then 6.. and so onn..

    well my problem is that when i click up on the numericupdown tool it goes straight to 2, it doesnt come up with one.. so how do i get around this :/

    cheers


    so wat i want to no is how to make the numericupdown box show 1 and the value of 1 = 1.5 so on (2 = 3.0, 3 = 4.5) so on

  2. #2

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2003
    Posts
    55
    cheerz

    its not exactly wat i wanted to do

    VB Code:
    1. ext1.Value = 1.5
    2.  
    3.         txtext.Text = Convert.ToDouble(BVAT.Text + ext1.Value)

    that the code i got for a button

    when the numeric up and down is pressed i want it to go up like

    1 - 2 - 3 - 4 - 5 - 6 so on

    but i want the value of 1 to b "£1.50" and the value of 2 to be " £3.00" but still show the 1 - 2 - 3 so on :/ all the 2 decimal places does is make it show the value :/ cheers for that i can use that 2 but main priority is wat is written above.. sorry my first example didnt clear it up

    thank you anyway highly apprciated
    Last edited by Ezpz; Jan 2nd, 2004 at 02:50 PM.

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2003
    Posts
    55
    bump

  5. #5
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    I think what you're trying to do is multiply the numericupdown value with 1.50 and add the listbox value.
    VB Code:
    1. Dim MyTotal As Double = (NumericUpDown1.Value * 1.5) + _
    2.                          Convert.ToDouble(ListBox1.SelectedItem.ToString)

    Is this what you are trying to do?
    Last edited by jovton; Jan 3rd, 2004 at 04:42 PM.
    jovton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width