Radio Buttons

Trying to display order in text box with each item on new line

Page 1 of 1

8 Replies - 1362 Views - Last Post: 15 June 2008 - 08:45 PM Rate Topic: -----

#1 neongabby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 06-June 08

Radio Buttons

Post icon  Posted 15 June 2008 - 06:59 PM

Hi,

I'm trying to create a photo order form. How can I get the options to appear in the text box. Each new item has to be on a new line i.e:

Jane Doe
4 x 6
3

Here is what I have so far. As always, any help is appreciated. I'd be lost without this site. Thanks.

Private Sub submitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submitButton.Click

'determine user entered their name for the order
If String.IsNullOrEmpty(orderName.Text) Then
MessageBox.Show("Please enter your name here.", "Missing value", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
orderName.Focus()
Exit Sub
End If

'determine print size and quantity radio buttons checked
Dim size As Integer
Dim quantity As Integer
Dim smallsize As String = "3 x 5"
Dim mediumsize As String = "4 x 6"
Dim largesize As String = "5 x 7"
Dim option1 As Integer = 1
Dim option2 As Integer = 2
Dim option3 As Integer = 3
Dim ordersummary As String
ordersummary = summaryLabel.Text

Select Case True
Case smallRadioButton.Checked
ordersummary = ordersummary + size
If smallRadioButton.Checked Then
ordersummary = smallsize
End If
If mediumRadioButton.Checked Then
ordersummary = mediumsize
End If
If largeRadioButton.Checked Then
ordersummary = largesize
End If
End Select
Select Case True
Case option1RadioButton.Checked
ordersummary = ordersummary + quantity
If option1RadioButton.Checked Then
ordersummary = option1
End If
If option2RadioButton.Checked Then
ordersummary = option2
End If
If option3RadioButton.Checked Then
ordersummary = option3
End If
End Select

'Display order
summaryLabel.Text = orderName.Text & (size) & (quantity)
End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Radio Buttons

#2 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:05 PM

It's kind of hard for me to figure your code, but there's something i can't figure out. Do you want the options they select to be in the textbox, or do you want them to enter their options in the textbox?
Was This Post Helpful? 0
  • +
  • -

#3 neongabby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 06-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:18 PM

View Postjacobjordan, on 15 Jun, 2008 - 07:05 PM, said:

It's kind of hard for me to figure your code, but there's something i can't figure out. Do you want the options they select to be in the textbox, or do you want them to enter their options in the textbox?


The select the radio buttons and then type their name in the text box. Their name and options selected should appear in the ordersummary label.

Thanks.
Was This Post Helpful? 0
  • +
  • -

#4 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:19 PM

And so, what exactly is your problem?
Was This Post Helpful? 0
  • +
  • -

#5 neongabby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 06-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:26 PM

View Postneongabby, on 15 Jun, 2008 - 07:18 PM, said:

View Postjacobjordan, on 15 Jun, 2008 - 07:05 PM, said:

It's kind of hard for me to figure your code, but there's something i can't figure out. Do you want the options they select to be in the textbox, or do you want them to enter their options in the textbox?


The select the radio buttons and then type their name in the text box. Their name and options selected should appear in the ordersummary label.

Thanks.


I can't get the selections to show in the text box. I've attached the instructions. I'm the world's worst at explaining (and at programming :)) I don' understand the new line outlined in the instructions. It hasn't been covered in our text book yet.

Thank you.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#6 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:34 PM

Quote

I'm the world's worst at explaining

Well, that's not very good because I'm the world's worst at figuring out what other people are trying to say, but let me see if i have this straight. You can't get the options the user selects to display on separate lines of the text box, is that right?

I have to leave, but if what i just said was correct, i can also solve your problem.
Put this code between each of the options:
Chr(13) & Chr(10)


That will create a new line, as if someone just pressed enter.
Was This Post Helpful? 0
  • +
  • -

#7 neongabby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 06-June 08

Re: Radio Buttons

Posted 15 June 2008 - 07:34 PM

View Postjacobjordan, on 15 Jun, 2008 - 07:29 PM, said:

Quote

I'm the world's worst at explaining

Well, that's not very good because I'm the world's worst at figuring out what other people are trying to say, but let me see if i have this straight. You can't get the options the user selects to display on separate lines of the text box, is that right?

Yes, that's right. It doesn't look like the options are displaying other than the person's name. I know my code is messed up somewhere. Hopefully the attachment I included last time helped a little. Thanks agian.
Was This Post Helpful? 0
  • +
  • -

#8 neongabby  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 06-June 08

Re: Radio Buttons

Posted 15 June 2008 - 08:15 PM

View Postneongabby, on 15 Jun, 2008 - 07:34 PM, said:

View Postjacobjordan, on 15 Jun, 2008 - 07:29 PM, said:

Quote

I'm the world's worst at explaining

Well, that's not very good because I'm the world's worst at figuring out what other people are trying to say, but let me see if i have this straight. You can't get the options the user selects to display on separate lines of the text box, is that right?

Yes, that's right. It doesn't look like the options are displaying other than the person's name. I know my code is messed up somewhere. Hopefully the attachment I included last time helped a little. Thanks agian.

jacobjordan had to leave, so if anyone else can help, I would appreciate it. The code he gave me worked for the newline, but I'm still playing around with trying to get the user's options to appear in the order summary label box.

Thanks.
Was This Post Helpful? 0
  • +
  • -

#9 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: Radio Buttons

Posted 15 June 2008 - 08:45 PM

Well, i looked at the doc in the attachment, and it looks simple. If all your having trouble with is making the users choices appear in the label, then i don't really know what your problem is. However, here is some code that will show the options in the label (label name = mylabel)
Function ShowText(byval Name as String, byval Ordersize as string, byval PrintNum as integer)
mylabel.Text = Name & Chr(13) & Chr(10) & Ordersize & Chr(13) & Chr(10) & PrintNum
End Sub


I assume your using vb.net 2005, since that's what it said in the doc, so also make sure that on the label properties, that the 'AutoSize' property is set to false. If that still doesn't solve your problem (or if i'm just way off) let me know.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1