C# Code

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2006
Posts: 2
Reputation: ShahdaaD is an unknown quantity at this point 
Solved Threads: 0
ShahdaaD ShahdaaD is offline Offline
Newbie Poster

C# Code

 
0
  #1
Dec 13th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: C# Code

 
0
  #2
Dec 14th, 2006
Originally Posted by ShahdaaD View 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
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.
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1
Reputation: fanofeducation is an unknown quantity at this point 
Solved Threads: 0
fanofeducation fanofeducation is offline Offline
Newbie Poster

Re: C# Code

 
0
  #3
Dec 27th, 2006
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";

}
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 8
Reputation: Aun Muhammad is an unknown quantity at this point 
Solved Threads: 1
Aun Muhammad Aun Muhammad is offline Offline
Newbie Poster

Re: C# Code

 
0
  #4
Jan 24th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 173
Reputation: RwCC is an unknown quantity at this point 
Solved Threads: 4
RwCC's Avatar
RwCC RwCC is offline Offline
Junior Poster

Re: C# Code

 
0
  #5
Feb 6th, 2007
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC