944,138 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 6022
  • C# RSS
Dec 13th, 2006
0

C# Code

Expand Post »
hi guys, I am a Beginer Programmer.
I Like to Learn about C# and i started from a week ago.
I Searched in google to find a froum to get some help about C#.
and i found this website.i hope i can find some friend to get help.
For first Question, i want to make a project and i have some question about it.
i have a Main page ( Form1 ) and i have a ComboBox on it.
i made a ComboBox with Readonly( true) and i put a RichTextBox under this ComboBox on mainpage.
now, in ComboBox i have 2 selecteditem.
i want to know how to write code for combobox that if someone klicked on first selecteditem in combobox then he will see in richtextbox for example ( hello ) , if he klicked on second he will see in richtextbox ( bye )?
Can someone please help me?
Thank you so much :p
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ShahdaaD is offline Offline
2 posts
since Dec 2006
Dec 14th, 2006
0

Re: C# Code

Click to Expand / Collapse  Quote originally posted by ShahdaaD ...
hi guys, I am a Beginer Programmer.
I Like to Learn about C# and i started from a week ago.
I Searched in google to find a froum to get some help about C#.
and i found this website.i hope i can find some friend to get help.
For first Question, i want to make a project and i have some question about it.
i have a Main page ( Form1 ) and i have a ComboBox on it.
i made a ComboBox with Readonly( true) and i put a RichTextBox under this ComboBox on mainpage.
now, in ComboBox i have 2 selecteditem.
i want to know how to write code for combobox that if someone klicked on first selecteditem in combobox then he will see in richtextbox for example ( hello ) , if he klicked on second he will see in richtextbox ( bye )?
Can someone please help me?
Thank you so much :p
We are more than willing to help, but we don't do the work for you. The idea is that you take the effort to learn for yourself, and when you get stuck or don't understand why something is not working or working for that matter, you can post the details here.

I would start with either a textbook or my personal choice is to go to the web and do a little research.

here is an ok link to a C# tutorial and slide show : http://www.devhood.com/training_modu...p/?module_id=2

One question is what version are you looking to learn? The latest and greatest version (3.0 framework) or C# on the 1.1 or 2.0 framework. I would personally recommend 2.0, but that is just a personal choice at this time.

Also, are you wanting to learn it for the web (i.e. ASP.NET with C#) or for Windows API (C# programming) ??


Here is a link to some other things that may help you get started:

Learning ASP.NET : http://www.asp.net/getstarted/default.aspx?tabid=61

C# General
http://www.c-sharpcorner.com/

Also I would spend some time reading the forums here as you may pick up a thing or two that will lead you to your answers.

Good luck.
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Dec 27th, 2006
0

Re: C# Code

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = "";
if (comboBox1.SelectedIndex.Equals(0) )

textBox1.Text = "hello";
if (comboBox1.SelectedIndex.Equals(1))
textBox1.Text = "bye";

}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fanofeducation is offline Offline
1 posts
since Dec 2006
Jan 24th, 2007
0

Re: C# Code

It can be achieved as:

if (cmbo.selectedindex==0) /////it will return first selected item...
rtb.text="Hello";
if (cmbo.selecteditem==1)////it willl return second
rtb.text="bye";


i think it will work.try it :regards
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Aun Muhammad is offline Offline
8 posts
since Jan 2007
Feb 6th, 2007
0

Re: C# Code

Hi there,

I would say read through as many books and sites as possible. This is one that I found very good when I was first starting out:
http://www.samspublishing.com/librar...seqNum=10&rl=1
Reputation Points: 70
Solved Threads: 4
Junior Poster
RwCC is offline Offline
173 posts
since Jan 2006
May 8th, 2010
-1
Re: C# Code
Click to Expand / Collapse  Quote originally posted by ShahdaaD ...
hi guys, I am a Beginer Programmer.
I Like to Learn about C# and i started from a week ago.
I Searched in google to find a froum to get some help about C#.
and i found this website.i hope i can find some friend to get help.
For first Question, i want to make a project and i have some question about it.
i have a Main page ( Form1 ) and i have a ComboBox on it.
i made a ComboBox with Readonly( true) and i put a RichTextBox under this ComboBox on mainpage.
now, in ComboBox i have 2 selecteditem.
i want to know how to write code for combobox that if someone klicked on first selecteditem in combobox then he will see in richtextbox for example ( hello ) , if he klicked on second he will see in richtextbox ( bye )?
Can someone please help me?
Thank you so much :p




hope this will help u

richtextbox=combobox.selectedItem
Reputation Points: 9
Solved Threads: 0
Newbie Poster
archa is offline Offline
2 posts
since May 2010
May 8th, 2010
0
Re: C# Code
[QUOTE=archa;1214190]hope this will help u

richtextbox.text=combobox.selectedItem
Reputation Points: 9
Solved Threads: 0
Newbie Poster
archa is offline Offline
2 posts
since May 2010
May 9th, 2010
0
Re: C# Code
Please read the rules before posting again - http://www.daniweb.com/forums/thread78223.html and rules.

Please do not resurrect old threads.
If you have any questions please ask. .... You are welcome to start your own threads.

Thread Closed.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in C# Forum Timeline: Listview: How do I get the data from a column in a selected row
Next Thread in C# Forum Timeline: Problem reading process output





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC