|
... and you'd still have to add public to the method.
|
|
|
|
|
not when you explicitly implement it, then no modifier is allowed.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
"double void" ? I want one of those!
|
|
|
|
|
mizitras wrote: Question was: Is this code executable? (Exam) Answer: No
Correct, it won't even compile.
mizitras wrote: Q for codeproject: CAN you compile, link and execute wrong code like this? Or is the only way to do so by supressing warnings and errors from the compiler?
Question 2 was: If it's not executable (which was assumed you've noticed), the question was: Why?
You can suppress warnings, not the errors. No, you still won't be able to compile this thing since the "double void Search()" will confuse the compiler. It won't make any assumptions about what you really mean here. You cannot have two return types.
mizitras wrote: And, how can you fix that, without changing the code of Punta-class.
You can't. The Punta class MUST be changed to specify a single return type for the Search method. Also, since the default protection level is private, you must specify the Search method as public or internal for it to be seen outside the Punta class.
An interface will NOT fix this problem since interfaces do not modify a class. Interfaces specify the methods that an implementing class must define. The class must still be modified to tell it which interface it's implementing. Either way, the Punta class must be modified in order for it to be fixed.
-- modified at 12:04 Tuesday 4th September, 2007
|
|
|
|
|
Aah dang, I accidentally typed "double void" instead of just double and void in the Search(void)
Now I've posted the wrong question
|
|
|
|
|
I would like to create a window with round edges with C#. In window Form there is a variable Region variable to set for such purposes.
First I can create a GraphicsPath with CreateGraphicsPath funcation.
public static GraphicsPath CreateGraphicsPath(Rectangle rect, float radius)
{
GraphicsPath gp = new GraphicsPath();
gp.AddLine(rect.Left + radius, rect.Top, rect.Left + rect.Width - radius, rect.Top);
gp.AddArc(rect.Right - radius, rect.Top, radius, radius, 270, 90);
gp.AddLine(rect.Right, rect.Top + radius, rect.Right, rect.Bottom - radius);
gp.AddArc(rect.Right - radius, rect.Bottom - radius, radius, radius, 0, 90);
gp.AddLine(rect.Right - radius, rect.Bottom, rect.Left + radius, rect.Bottom);
gp.AddArc(rect.Left, rect.Bottom - radius, radius, radius, 90, 90);
gp.AddLine(rect.Left, rect.Bottom - radius, rect.Left, rect.Top + radius);
gp.AddArc(rect.Left, rect.Top, radius, radius, 180, 90);
gp.CloseFigure();
return gp;
}
After that set
GraphicsPath gp = CreateGraphicsPath(ClientRectangle, radius);
this.Region = new Region(gp);
gp.Dispose();
After some time I would like to increase the size of window, which I am unable to do so. I tried creating new path and set to this.Region, but did not work. The window is not round any more. Any clue?
Thanks in advance if someone put light on it. If someone like to have code how I am increasing the size I can send the code as well.
agha.khan@hotmail.com
Agha Khan
|
|
|
|
|
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
|
|
|
|