|
No, that is an utter disaster, it cannot work. The Form1 inside form2 is completely irrelevant to the Form1 that you are working with.
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 )
|
|
|
|
|
I assume they are not called that....
If you want to pass data from form1 to form2, pass it through the constructor or through properties, if you want to pass data from the child to the parent, set up delegate methods to do so. Whatever you do, set up the smallest scope properties you can, i.e. set up a string property to set the text of a textbox, rather than making the textbox itself public.
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 )
|
|
|
|
|
Hi Chris....thts what I precisely did....i created 3 public properties on Form1 each to capture cell values of the grid data and then in Form2 I created an instance of Form1 and using it i accessed those properties, but since each time the Form2 loads, it would create a new instance which wud be null, the text boxes are empty. Now, do we have a way to modify this to work
|
|
|
|
|
Yep - that's the issue. A new instance of Form1 has nothing to do with the instance in use in your program. I recommend reading a book on OO.
gladiatron wrote: Now, do we have a way to modify this to work
Going from form2 to form1, you should use delegates.
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 )
|
|
|
|
|
Hey Chris and Rahul.....thannx a lot ..constructor technique worked .....but is there any other way to do it?
|
|
|
|
|
|
obviously when you create any object instance, it allocate new empty memory. So just do one thing in form1 click event.create form2 instance, after then assign grid cell in form1 to form2 public property.Now in form2 load event assign that property to each textbox of form2.Now show form2.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Hi.
I have written a code which will prevent multiple instance of a exe to be executed.the code which i wrote is as below
if (processes.Length != 1)
Application.Run(new FormCacheProcessor());
else
MessageBox.Show("Already An Instance of CacheManager Application is Running");
but now i want instead of this message box being poped up, i want already running instance of exe to come to the foreground..i have used SetForegroundWindow but its not working..
Can any pls help me in working it..
Thanks in advance.
Regards
DilipRam
|
|
|
|
|
Rather than rolling your own code to manage this, why not use what .Net 2 provides for you? This[^] set of pages tells you all you need to know on how to do it.
|
|
|
|
|
Hi thanks for the reply..i went through the page you provided but i got confused...have any one work on that specific problem.i just want to activate the already running exe to foreground...
thanks
Regards
DilipRam
|
|
|
|
|
How do I do a mouse over on a GIF picture? I want to get X and Y position on the gif I display over the form. Currently I can only see the mouseover pos on the form surface only not on the picture how do I do the opposite?
Thanks
Samuel
|
|
|
|
|
Hello,
Is this picture in a pictureBox?
If yes, you would have to handle MouseMove there!
All the best,
Martin
|
|
|
|
|
I am sorry, I dont know how to handle mousemove there? and yes its in a picture box. Do you have an example of how I can do this??
Thanks
Samuel
|
|
|
|
|
Hello,
this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
string actmouseposition= "X: " + e.X + "; Y: " + e.Y;
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Yes! it works like a charm! Thanks lots!
Thanks
Samuel
|
|
|
|
|
|
i think u should display gif image in some container like picture box
and then u can get the coordinates of picture displayed.
rahul
|
|
|
|
|
Somethign that isn't clear from the documentation I can find:
"Application Settings", as supported by the .NET framework and IDE, are stored in {app}.exe.config in the executable folder.
Doesn't that mean they can be written only during setup (or by administrators)? I.e. they are off limits for settings the application wants to remember for later, if the application ever wantsto run under a limited account.
|
|
|
|
|
No, it's an xml file, you can edit it later, if you want to, that's kind of the point, the settings are external from the app in a human readable file.
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 )
|
|
|
|
|
Well, "Human readable" is subjet to discussion
My point was: the application can't store settings in there at runtime, because that would violate the rule not to write to the program directory.
|
|
|
|
|
I haven't tried it myself, but surely you should be able to open it as a regular XML file and write to it?
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
Where can i find a very good example of AX4 Business Connector in Vis. C# programming.
|
|
|
|
|
Return ((True) And (False))
satish
|
|
|
|
|
satishkumarnk wrote: What is use of this return statement
No intelligent one, I guess!
satishkumarnk wrote: Return ((True) And (False))
Apart from, it is not C# code, it allways returns "false"!
All the best,
Martin
|
|
|
|
|
Waste readers' time...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|