Click here to Skip to main content
15,889,815 members
Home / Discussions / C#
   

C#

 
AnswerWorld Pin
Not Active18-Nov-11 5:44
mentorNot Active18-Nov-11 5:44 
GeneralRe: hello Pin
Dan Mos18-Nov-11 6:02
Dan Mos18-Nov-11 6:02 
AnswerRe: hello PinPopular
Pete O'Hanlon18-Nov-11 6:36
mvePete O'Hanlon18-Nov-11 6:36 
GeneralRe: hello Pin
Dan Mos18-Nov-11 6:39
Dan Mos18-Nov-11 6:39 
GeneralRe: hello Pin
Pete O'Hanlon18-Nov-11 7:31
mvePete O'Hanlon18-Nov-11 7:31 
AnswerRe: hello Pin
loyal ginger18-Nov-11 7:14
loyal ginger18-Nov-11 7:14 
AnswerRe: hello Pin
R. Giskard Reventlov18-Nov-11 7:49
R. Giskard Reventlov18-Nov-11 7:49 
QuestionGrid in a pictureBox, how to add certain letters in a word to a "Grid-box"? Pin
Member 839407317-Nov-11 23:42
Member 839407317-Nov-11 23:42 
Hello!

I'm, a novice student and have just started my first course in programming in VisualBasic C#.

We have been set with a task to program a word-game called LINGO (which already exist on this website)and ive been assigend to do the design-part of the programming. the game consist of a pictureBox with a grid on it (using drawLine) which creates 5 * 5 boxes.
I want to connect each "box" in the grid to a certain letter in a five-letter word, first letter in first box, second letter in second box etc. These words are to be put in through a textBox.

I have made an early draft with Coordinates for each word without any connection to the boxes or the pictureBox at all, they are simply put on top of the pictureBox.

this is the draft-code so far:

C#
private void button1_Click(object sender, EventArgs e)
{
       textBox_Input.Text.ToUpper();

       Graphics grf = this.pictureBox_Output.CreateGraphics();
       try
       {


           using (Font myFont = new Font("Arial", 40))
           {


               grf.DrawString(textBox_Input.Text, myFont, Brushes.Green, new PointF(4, 10));
               grf.DrawString(textBox_Input.Text, myFont, Brushes.DarkRed, new PointF(4, 90));
               grf.DrawString(textBox_Input.Text, myFont, Brushes.Yellow, new PointF(4, 170));
               grf.DrawString(textBox_Input.Text, myFont, Brushes.DarkRed, new PointF(4, 250));
               grf.DrawString(textBox_Input.Text, myFont, Brushes.Green, new PointF(4, 330));


           }
       }
       finally
       {
           grf.Dispose();
       }




Question:
How do i connect each "box" in the grid present on the pictureBox to a specific letter in a word? Is there an easier way to accomplish this?

NOTE: I've checked out the code of the existing LINGO-game on this website but couldnt make any out of it. (Like I said, novice Smile | :) ).

I'm very thankful for your help.
AnswerRe: Grid in a pictureBox, how to add certain letters in a word to a "Grid-box"? Pin
Richard MacCutchan18-Nov-11 1:39
mveRichard MacCutchan18-Nov-11 1:39 
GeneralRe: Grid in a pictureBox, how to add certain letters in a word to a "Grid-box"? Pin
Member 839407318-Nov-11 2:05
Member 839407318-Nov-11 2:05 
GeneralRe: Grid in a pictureBox, how to add certain letters in a word to a "Grid-box"? Pin
Richard MacCutchan18-Nov-11 2:18
mveRichard MacCutchan18-Nov-11 2:18 
QuestionThread.WaitReason Pin
CTF6617-Nov-11 20:05
CTF6617-Nov-11 20:05 
AnswerRe: Thread.WaitReason Pin
Ravi Bhavnani18-Nov-11 2:04
professionalRavi Bhavnani18-Nov-11 2:04 
GeneralRe: Thread.WaitReason Pin
CTF6620-Nov-11 9:47
CTF6620-Nov-11 9:47 
QuestionSelecting/Deselecting items by checking checkboxes in a listview impossible? Pin
teknolog12317-Nov-11 7:32
teknolog12317-Nov-11 7:32 
AnswerRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
Pete O'Hanlon17-Nov-11 7:40
mvePete O'Hanlon17-Nov-11 7:40 
GeneralRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
teknolog12317-Nov-11 7:59
teknolog12317-Nov-11 7:59 
GeneralRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
Matt U.17-Nov-11 8:19
Matt U.17-Nov-11 8:19 
GeneralRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
teknolog12317-Nov-11 21:59
teknolog12317-Nov-11 21:59 
GeneralRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
Matt U.21-Nov-11 2:40
Matt U.21-Nov-11 2:40 
AnswerRe: Selecting/Deselecting items by checking checkboxes in a listview impossible? Pin
BobJanova18-Nov-11 2:22
BobJanova18-Nov-11 2:22 
QuestionMaping Network Drive Pin
M Riaz Bashir17-Nov-11 6:09
M Riaz Bashir17-Nov-11 6:09 
AnswerRe: Maping Network Drive Pin
Matt U.17-Nov-11 6:44
Matt U.17-Nov-11 6:44 
GeneralRe: Maping Network Drive Pin
M Riaz Bashir17-Nov-11 6:45
M Riaz Bashir17-Nov-11 6:45 
GeneralRe: Maping Network Drive Pin
Mycroft Holmes17-Nov-11 13:18
professionalMycroft Holmes17-Nov-11 13:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.