By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

Combobox items displayed in label!

P: 5
Hi ppl i need help wif a project im workin on 2 write my next exam... plz have a look

-A word must be selected from a combobox(already made..) and displayed in a label ( also made..) before any radiobuttons can be selected( fuctions like Uppercase ect.), If the user tries to select a function before selecting a word from the combobox first an error message must be displayed to select a word first.

and thats it plz have a look at that and tell me your thoughts ta ppl :P
Feb 22 '07 #1
Share this Question
Share on Google+
6 Replies


Banfa
Expert Mod 5K+
P: 8,916
The real point is that the label must contain a word before a function is selected.

In you code handling the radio buttons all you need to do is check to see if there is already a word in label, if not output the error message.
Feb 22 '07 #2

P: 5
Ta Banfa man for the fast response i sorted that out tho, but still need ur help on another topic :/

-after the i have selected the item from the combobox and it is displayed in the label, im suppose 2 be able 2 click on a radiobutton 2 convert the text 2 uppercase here it is plz have a look:

Expand|Select|Wrap|Line Numbers
  1. if(radioButton1.Checked == true)
  2.     {
  3.  
  4.     string stringResult;
  5.     tring str1 = label1.Text;
  6.  
  7.     stringResult = str1.ToUpper();
Feb 22 '07 #3

tbarto
P: 19
Ta Banfa man for the fast response i sorted that out tho, but still need ur help on another topic :/

-after the i have selected the item from the combobox and it is displayed in the label, im suppose 2 be able 2 click on a radiobutton 2 convert the text 2 uppercase here it is plz have a look:

if(radioButton1.Checked == true)
{

string stringResult;
tring str1 = label1.Text;

stringResult = str1.ToUpper();
Are You saying that after You CHECK the button, the conversion is performed? You may use some Event Handler:


Expand|Select|Wrap|Line Numbers
  1. this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
  2.  
  3. private void radioButton1_CheckedChanged(object sender, EventArgs e)
  4. {
  5.     if(radioButton1.Checked)
  6.     {
  7.  
  8.     string stringResult;
  9.     tring str1 = label1.Text;
  10.  
  11.     stringResult = str1.ToUpper();
  12.         }
  13. }
  14.  
Feb 23 '07 #4

P: 5
TA! tbarto got my prob sorted out! i need another solution on randoms...

I need help to be able 2 click on a radiobutton 2 change the word 2 a random style(Bold, Itelic, Underline) and random size plz paste an example tell me how 2 generate the randoms plz :P TA
Feb 23 '07 #5

Banfa
Expert Mod 5K+
P: 8,916
Look up the functions

srand - seed the random number generator, should only be called once
rand - generate a random number, call as often as required
Feb 23 '07 #6

P: 5
thx ppl for all the help now i can get on wif my studies ta again and keep up the good work :D
Feb 26 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.