|
Double-posting your questions is considered rude. People will notice and probably ignore both posts.
Consider carefully which forum is most appropriate for your question and post there. If someone wants to help you, they will do so. Double-posting only decreases your chances of getting help.
Paul Marfleet
|
|
|
|
|
Can I define a parameter such as "out string[][] myParameters" ?
|
|
|
|
|
jason_mf wrote: Can I define a parameter such as "out string[][] myParameters" ?
yes.
try it.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
Is there any way of setting a DataGridViewRowHeader to show a CheckBox inside?
Thanks
|
|
|
|
|
There is no build-in way to do that. What I have done when I wanted to do something like that was create the CheckBox on the fly, and set the position to inside the row header you want it to be in. Then in the resize event on the control have it move the check box to the same position on the row header.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi,
I have a form that has a data grid on it with name and address columns.
When a user adds their name and address details to the table and clicks on the details button I want their data to automatically be added to the details form using text boxes.
I'm unsure of the code for data value details?
frm.customer =
Can someone please help me?
Thanks in advance
|
|
|
|
|
Set up a delegate to pass the data between forms
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 )
|
|
|
|
|
This, again has to do with graphics, because I 'lost' the other posts, but I still have the thoughts around. My plan was to make a VERY, basic simple game called 'Squares'. There are to squares. You move with the arrow keys (I completed this), and try to keep your square from touching the other. (I can do the collision). The only thing I need to now is how to move the square (player). I'm trying panel1.Invalidate(); right now...
Thanks again, for those who keep reading... AND in advance.
|
|
|
|
|
|
I'm not sure where you're stuck. You are changing the values for the square, but it's not redrawing ? If you have another square moving all the time, you should have a timer which, when it fires, changes the position of the other square(s) and calls Invalidate(). What's panel1 for ? You probably want no controls on your form at all, it will just comprise of the game. In this case, you call this.Invalidate(); this is superfluous, but it makes the scope clear.
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 )
|
|
|
|
|
Could you give an example? I tried this.Invalidate(); and nothing happened.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Invalidate will definately cause your form to repaint itself. Put a breakpoint on the invalidate call to see when it gets called, then when it's called, put one in your paint event and step through to see why your box is not being drawn as you expect.
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 )
|
|
|
|
|
What's a breakpoint do? Simple question probably, but I'm new...
The most knowledge doesn't mean the most wise...
|
|
|
|
|
I JUST GOT IT TO WORK!! THANKS A LOT!!!;P
The most knowledge doesn't mean the most wise...
|
|
|
|
|
NP - sorry I didn't come back sooner, very busy day for me today.
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 )
|
|
|
|
|
It's cool.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Hi to All,
This is my first aquaintance with the forum as I am new to this forum as well as C# also.
So the question may be foolish & yet it prevails.
Hope you understand me ..
Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting...
Thanks in anticipation..
Regards
-- modified at 3:25 Sunday 14th October, 2007
|
|
|
|
|
I'm almost 100% sure, that it is necessary.
Your application needs to be executed somewhere in the code.
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Hi,
to have a live Windows app, showing Windows and reacting to the user, you need
a "message pump", i.e. an event queue that collects GUI events, and a loop that reads
from that queue and executes the messages. The normal way to achieve this is by
calling Application.Run(); there may be other ways to achieve the same, but nothing
as simple as the one line that does everything that is required.
BTW: you don't need Application.Run() when you don't need the message pump, as in
a Console app.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Question - why do you think it's there, if it's not necessary ? Why do you want to bypass it ?
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 )
|
|
|
|
|
Thanks to all ...
Really..
So now I get that the message pump that is required is provided by Application.Run(). Otherwise the application would die without any messages..
Thanks once again folks.
|
|
|
|
|
dear all,
I need a way to query a dns for example "ns1.whatever.com" ;
in order to get domain entrys on this NS ...
i need to do something like this site http://domainsdb.net/[^] but in windows application ...
thanks in advance for your co-operation
Davids Maguire
|
|
|
|
|
Check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I'm going to break out my question into a smaller sub-question this time, instead of trying to fit two questions into one post.
I basically have a method Control.PerformOngoingOperation that can call other methods, with string IDs assigned to each calling. Its signature is, currently:
object PerformOngoingOperation(Delegate method, out string id, params object[] args)
However, as far as I can tell, the user then has to declare a delegate every time:
class C
{
delegate int annoying(int param1, bool param2, string param3);
void Method()
{
string id;
int retVal = (int)Control.PerformOngoingOperation(new annoying(Library.Object.Method), out id, 5, true, "test");
}
}
I suppose an alternative is requiring that the delegate be of type MethodInvoker (basically void return type, no parameters), as such:
string PerformOngoingOperation(MethodInvoker method)
and forcing the user to do this:
int retVal;
string id = Control.PerformOngoingOperation((MethodInvoker)(new delegate() { retVal = Library.Object.Method(5, true, "test"); }));
But that's awkward at best.
Ideally I would like to have something like this instead:
string id;
int retVal = Control.PerformOngoingOperation(Library.Object.Method, out id, 5, true, "test");
Is that possible? If so, what's the syntax?
-Domenic Denicola- [CPUA 0x1337]
“I was born human. But this was an accident of fate—a condition merely of time and place. I believe it's something we have the power to change…”
|
|
|
|
|
Domenic wrote: string PerformOngoingOperation(MethodInvoker method)
Something like that, yeah.
One thing to keep in mind is, the C# 2 compiler can infer the delegate type. So if you define it with a MethodInvoker (or a SendOrPostCallback, or any other delegate), the compiler can infer the delegate from usage. For instance, you can call it like this:
Control.PerformOngoingOperation(Lib.Obj.Method);
Notice how you didn't need to declare new MethodInvoker(Lib.Obj.Method) , the C# compiler inferred that Lib.Obj.Method has a signature matching MethodInvoker, so you don't have to explicitly create a new delegate instance there. Does that help?
The reason this doesn't work with Control.PerformOngoingOperation(Delegate del, ...) is because the compiler doesn't know which delegate to use with it, so it forces you to create a new delegate around the function you pass in.
|
|
|
|