|
Hey
I am creating a draughts game just to get me back into C# and I need to deal with user clicks (the user may click on a piece and then another valid sqaure on the draughts board) now rather than reading the mouses coordinates and looping through each piece or square until i find the correct one to send a message to is there a way of using the framework to handle this (maybe a class to derive from) or is this the best way of doing it?
Thanks
Dan
|
|
|
|
|
Your best bet is probably the way you're doing it, unless you feel it's justfied to write a class to handle each square, then you can iterate over those classes, looking for a hit.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You could create a UserControl that contains an 8x8 array of Button s - this would do away with the need to perform any hit test calculation.
/ravi
|
|
|
|
|
I would use one Panel the size of the playing board; and in its Click handler, convert
the mouse coordinates to the square's coordinates using division by square size.
No need to iterate at all.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Cheers every one - thats what i thought - the division by square size is a good idea, and the way Chris said was what I expected.
Dan
|
|
|
|
|
Hi, im using the WebBrowser control in my application.
When im accessing webBrowser1.Document everything is fine, but everytime i want to access the document of a frame (webBrowser1.Document.Window.Frames[0].Document) i get "UnauthorizedAccessException was unhandled". I tried different sites, but always the same.
When im using firefox or IE7 im always able to see the html code of the desired frames, but not in my application ...
Any suggestions?
|
|
|
|
|
Hello everybody,
In my study i need to build a spam filter using Artificial Immune System technique by C# programming.
I need to build my own one and will integrated with email client such as Mozilla Thunderbird.So,anybody got any source or opinion regarding this thing
|
|
|
|
|
starline wrote: anybody got any source or opinion regarding this thing
Nope, but you can be the first I suggest start planning/designing algorithms to accomplish this, and people on these forums are here to help if you get stumped.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hmmmm...I will design it and share with you all,anyway thanks a lot
|
|
|
|
|
Any trouble with design ideas, just drop a line here
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
This book[^] might help. You've picked a really ambitious topic here so good luck.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for your comment,I'm faced new problem now,I need to connect my spam filter to email client(Email client such as Microsoft Outlook,Mozilla Thunderbird etc).I don't know how to connect to that particular email client.
Somebody got any idea?
Thanks.
|
|
|
|
|
Hello
I check for the value entered in a txtbox and i put a new one with the ability for the user to add something on it:
if the value was greater than 12 i divise the number by 10 so the number in the txtbox would be 1
but what if the user want to enter 12, if he enter the number 2 and i have already 1 the number will be 21 and not 12
So how i can let the cursor be after the number i put in the txtbox after divid by 10
Thanks in advance
Assaf
|
|
|
|
|
Use TextBox.SelectionStart to set the position of the carret.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
i have an mdicontainr and i want that his mdichildren will not expand his border, how can i do it ?
(if a form us drag to the limit of the containr the container is grow )
|
|
|
|
|
Hello
I want to launch from C++ a other C# application with paramters.
I use ShellExecute(handle, "param1", csharpapplication, NULL, NULL, SW_SHOWNORMAL);
But i'm newbie in C# and i want to retrieve "param1" paramters when csharpapplication is initialized.
Help me please
|
|
|
|
|
Environment.CommandLine or Environment.GetCommandLineArgs()
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
ok nice Environment.GetCommandLineArgs() works fine.
|
|
|
|
|
The Main() method of your c# application should have a string[] parameter. This array will hold all the values that are passed to the application
|
|
|
|
|
Hi all
I have a datagrid developed in 2005.I am populating datatable with recordset and assigning the datatable to the datasource of grid.The data contains one parent and its child..so when i click on parent automatically its child will also be selected.Now if sort the grid based on any columns my entire selection logic will fail that means datatable is not updated as i sort the datagrid and hence my logic fails.How can i over come it.When i was searching the net i found that use some default view of grid then go for it ,but i am not clear on it.Can any one help me on this
Regards
DilipRam
|
|
|
|
|
No google plz give me any idea About best GUI any website
SAS
|
|
|
|
|
sajid.salim.khan wrote: plz
No textspeak, please
On a serious note, what exactly do you mean by best GUI? That is sort of in the eye of the beholder type of matter...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Why no google? It's a very valuable resource for finding things out.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Try live search, or perhaps webcrawler is still in business ?
Seriously, your question makes no sense, best GUI for what ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Send me email and I will send you some nice GUI by me.
Best regards
Agha Khan
agha.khan@hotmail.com
Agha Khan
|
|
|
|