Hello Everyone,
I am a new user to learning C# therefore I haven't adapt myself to the language terminology.
I like to know if I can get help with thispiece of code.
----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using
System.ComponentModel;using
System.Data;using
System.Drawing;using
System.Linq;using
System.Text;using
System.Windows.Forms;namespace
ChatterBox{
public partial class Form1 : Form{
public Form1(){
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e){
string[] strLabel = { "Hi", "Chao", "Hello"};
Random hello = new Random(); int iSelect = hello.Next(0, 2);textBox1.Text = strLabel[iSelect];
}
private void button1_Click(object sender, EventArgs e){
{
textBox1.Clear();
textBox2.Clear();
}
}
}
}
----------------------------------------------------------
----------------------------------------------------------
So what this code does so far is when it runs a random text appears from textBox1 then after I enter something textBox1 and textBox2 clear when I click on 'Enter' button. I'm not sure where to go from here. I like textBox1 to accept a random word, from 3 words, and have the cursor in textBox2 waiting for my input.
This is all I can try and do for now. Any help is greatly appreciated.
Thank you.
VulpesPosted Mar 8, 2014, 4:25 PM
It's just a question of how you want to present it.
For example, do you want to record the whole conversation or just the latest question/answer pair?
Tri CutherellPosted Mar 7, 2014, 7:51 PM
I'm trying to create a simple chatbox between the computer and me. When the computer ask a question he has three words or sentences to choose from.
Thank you.
VulpesPosted Mar 7, 2014, 7:44 PM