|
As this is your first post, may I suggest that you read the various FAQ's under the Help[^] menu option.
|
|
|
|
|
Bye!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
You forgot World.
No comment
|
|
|
|
|
Sup?
Yo yo yo yo. Dude. sssssssuupppppp
All the best,
Dan
|
|
|
|
|
Ignore the 1 votes. As you are new here, you probably aren't aware of the etiquette for posting here on Code Project. If you just want to post a general chew the fat type of post, then you should head to the lounge, soapbox, general indian or general chinese forums. Note that people tend to be a bit more tolerant of posters who are learning the ropes in the Indian forum. That might be a good place to start. Avoid the back room while you are new, it is not for the timid.
If you actually want to ask a technical question, pick the appropriate forum and ask it there. Try to be specific and make sure you have picked the most appropriate forum. For instance, don't pick the C# forum if your question is actually about Silverlight.
Anyway, welcome to Code Project.
|
|
|
|
|
I've actually 5éd it cause I found it "innocently" funny.
All the best,
Dan
|
|
|
|
|
I failed then. I was aiming for ironically funny.
|
|
|
|
|
Thanks for the greeting after more than 7 dormant years. What's up with you in the past 7 years?
|
|
|
|
|
You do realise this forum is to ask c# questions? Hence you have been flamed (rightly so). Try this in the lounge but expand a little bit: hello is great when you meet someone in person but a tad meaningless on it's own here.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
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:
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 ).
I'm very thankful for your help.
|
|
|
|
|
As a first point you should not be painting your control in a button click event. That event should capture whatever information is needed to repaint the control, but the actual painting should be done in the OnPaint[^] event. As to connecting letters with points in the grid, you need to track the grid location of each letter in your code and then paint it in the appropriate point on the screen according to which grid box it belongs to. This is merely a matter of using some transform to convert the character location (say row 2, column 3) into a screen location, which will be based on the actual location and size of your grid in screen coordinates.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thank you sir for the awnser.
I'm not that familiar with the OnPaint event - techniques but i will certanly look into it.
How would i go about in the code to find specific letters and then place them on the pictureBox?
Could you give a code-example?
Thankfull for any awnsers.
|
|
|
|
|
Member 8394073 wrote: How would i go about in the code to find specific letters and then place them on the pictureBox?
Think about it; you need to start by storing your letters inside your program, probably by some sort of collection[^], or your own class, etc. Each object then comprises the letter and its current position within your grid, and as the letters are moved by the user you update this information and repaint them in the appropriate place.
Given some of your comments I wonder whether you should be tackling this subject without first spending time studying some of the more basic aspects of the language. There are lots of samples here in the Articles[^] section, and also some very useful quick C# tutorials[^] on MSDN.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Does anyone know of a resource that explains
Process.WaitReason specifically
ThreadWaitReason.ExecutionDelay
Thanks, Clint
|
|
|
|
|
|
Thanks for taking the time to reply, but not really what I was looking for, I was after a detailed description not just the name. There in lies my problem.
Clint
|
|
|
|
|
hi, I almost tried everything but couldn't make the listview items be selected when checkbox checked and deselected when unchecked. Am I asking for an impossible thing?
Checking the boxes to select is fine but when I uncheck any of the items, all of them are unselected. I didn't eat my brain with more complicated problems but this one will make me do it
|
|
|
|
|
What technology stack? Win forms? ASP.NET? WPF? Silverlight?
|
|
|
|
|
|
May I ask why the items must be checked/unchecked AND selected/deselected? What you are witnessing is the default behavior of the ListView. When you check multiple items and select each one, and then you uncheck one, it unchecks all items. Just like if you CTRL+Click to select multiple items and then check ONE of them, they all get checked. I am not certain but perhaps you would need to extend the ListView control yourself?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Matt U. wrote: May I ask why the items must be checked/unchecked AND selected/deselected?
modified 18-Nov-11 8:19am.
|
|
|
|
|
I believe you would need some sort of custom control for that, although I am not certain even that would give you exactly what you need. As the last answer stated, why not just use the ListView's selection without checkboxes?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Why do you want checkboxes for selection? There is already a perfectly sensible and standard way of multiply-selecting items in a list view.
|
|
|
|
|
hi
Let me know, How may I use following command using C#?
net.exe use Y: \\127.0.0.1\\DATABASE
Thanks
(Riaz)
|
|
|
|
|
The System.Diagnostics.Process.Start(...) method seems to be what you need.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|