|
It is the same thing, I guess you didn't post that code in your previous post.
Ben
|
|
|
|
|
Yes, I didn't post it.
I also tried to use PostMessage instead of SendMessage. But I don't get appropriate results.
Any idea ?
Thx.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
|
thanks.
p.f. Goudjo-Ako
Bringing our energy together !
|
|
|
|
|
Hi all,
i have a class that that contains 3 class objects and 3 dataset proerties.
how can i use xml serialization to this class?
i am using xml serialization technique in .net 2005,i got the xml file but it contains xml schema file also. that comes in built at the time of serialization.is there any xml attributes or any method to seperate or disable the xmlschema file with xml file.
is it possible convert the dataset property to arraylist property at the time of serialization?
can any one help me please?
Thnaks
Raja
-- modified at 13:15 Tuesday 5th June, 2007
|
|
|
|
|
Implement IXmlSerializable
only two letters away from being an asset
|
|
|
|
|
Hi thanks for answering. i am new to xml and C# can u please how can i implemnet IxmlSerializable
Thanks
Raja
|
|
|
|
|
Hi mark can u please help me?
how can i apply ixmlserializable
Thanks
raja
|
|
|
|
|
|
Thank u very much
If i got any doubt i will contact u
Thanks
raja
|
|
|
|
|
Why are you creating the New thread for the same topic? in BTW don't create new thread?
I have answered you in the Previous topic itself.
Regards,
Satips.
|
|
|
|
|
I'm writing a program, where the user should be able to enter a function (for example x^2 + 4*x+3) in the interface. The function needs then to be parsed, a derrivation has to be found and the results computed by using different parameters.
Don't wanna write a parser by myself, can somebody suggest a parser/library for such things?
if freedom is outlawed, only outlaws will have freedom
|
|
|
|
|
|
HA-HA )
I've looked on google but all what I found yet are parsers, that evaluate the function with pre-defined variable-values. If a variable is unkown and I just want to operate with the funktion, without inserting any values - they fail.
I'm sure there schould be anywhere the right one, but I'm loosing time searching for it - if someone knows any it would be nice )
|
|
|
|
|
I am currently writing a text adventure in c#.
What I have is a 3 by 3 array with 0's and 1's in a specific order.
010
111
010
Basically anywhere theres a 1, thats a valid location for the person to move to.
What I need is a way to pull the value out of an array position say array[1,1]
This isnt all the code but you get the picture.
int intWall = 0;
intWall = arrWall[x,y];
if (intWall == 0)
{
Console.WriteLine("You can't move that way.");
}
// I need some way of putting the value of the x,y spot in the array to the variable
|
|
|
|
|
Do you need this:
arrWall[1,0]=0;<br />
arrWall[1,1]=1;
?
jblouir wrote: int intWall = 0;
intWall = arrWall[x,y];
if (intWall == 0)
{
Console.WriteLine("You can't move that way.");
}
You can write just this:
if (arrWall[x,y] == 0)<br />
{<br />
Console.WriteLine("You can't move that way.");<br />
}
|
|
|
|
|
Odd I thought I tried that, thanks =).
I am pretty sure I tried to check the value using...
if (arrWall[x,y] == 0)
{
etc..
}
and it came back with something like cant perform on
Its working now though thanks for the help! =D
|
|
|
|
|
may you try to cast the value that way:
if ((int)arrWall[x,y] == 0)
{
etc...
}
i think it should work!
|
|
|
|
|
Hi!
i am facing a problem in hiding the main form. I am using notifyicon control to show the application in system tray. When user minimizes the application it hides the main form and displays the notifyicon in system tray, and on clicking the notifyicon, maximize & unhide the main form...
all this was working fine until i added a splash form at start. On load event of splash form i am performing some functions and then hide the splash form and show the main form using frmMain.ShowDialog() and after it close the application.
now when i minimize the main form it hides the form as expected but soon after hiding the form it closes the application.
after debugging it showed that when i hide the main form, it closes the form and returns to the place from where it was called (load event of splash form) and then close the splash form.
Please tell me how to handle this situation?
Thanks in advance...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
hmmmm i have a feeling this is going to be start point and/or main thread related.
seems like the splash screen you added hasnt really been added to the main form, its taken over from it and the main form is not a sub-form.
[STAThread] may be also causing you problems
sorry i cant really help any more than that, i've got a meeting to get to (lucky me)
)
|
|
|
|
|
Hi,
please explain, or better yet show code, for Main, splash screen and mainForm
(constructors, timers, show/hide/visible stuff).
|
|
|
|
|
Thanks for reply....here's some code of splash and main form...
Code for load event of splash form:
private void frmSplash_Load(object sender, EventArgs e)
{
// .....
// Some functions....
// .....
this.Hide();
Form objFrmMain = new frmMain();
objFrmMain.ShowDialog();
Application.Exit();
}
Code for resize event of main form:
private void frmMain_Resize(object sender, EventArgs e)
{
if (this == null)
{
return;
}
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
notifyIcon1.Visible = true;
}
else
{
this.Show();
notifyIcon1.Visible = false;
}
}
Code for restoring the main form:
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
ContextMenuStrip cms = new ContextMenuStrip();
cms = contextMenuStrip2;
cms.Items[0].Visible = true;
cms.Items[1].Visible = true;
}
else
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Show();
notifyIcon1.Visible = true;
this.WindowState = FormWindowState.Maximized;
}
// Activate the form.
this.Activate();
this.Focus();
}
}
Following is the code in Program.cs, this may also be useful...
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmSplash());
}
When i minimize the main form, frmMain_Resize event is executed and after this frmMain closes and the Application.Exit() is executed and application closes.
Hope this helps you understanding the ptoblem, looking forward for your reply...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
ShowDialog is the problem. It stops blocking when the form is closed OR hidden. Basically, it's the wrong method to use in this situation.
There are plenty of ways to set this up, but here's one suggestion:
<br />
static void Main()<br />
{<br />
...styles and such...<br />
frmSplash splash = new frmSplash();<br />
Application.Run(splash);<br />
frmMain main = splash.GetMainForm();<br />
Application.Run(main);<br />
}<br />
In frmSplash:
<br />
private frmMain _mainForm;<br />
public frmMain GetMainForm() { return _mainForm; }<br />
In frmSplash_Load (Or wherever you want to do the actual work):
<br />
_mainForm = new frmMain();<br />
...<br />
this.Hide();<br />
Basically, the sequence of events here is:
1) Main() runs an application loop on the splash form
2) Splash form, once loaded, loads the main form
3) Splash form hides itself
4) Main() continues, and grabs a reference to the main form
5) Main() closes down the Splash form (It was just hidden)
6) Main() runs an application loop on the main form
I'm sure there are many other, and better, ways to do this, but here's the first example I came up with.
ADDENDUM to clarify: The point of this, is that if your frmMain instance is called from an Application.Run() instead of a ShowDialog, the application won't exit until it actually closes, so you can hide it all you want.
|
|
|
|
|
I agree.
|
|
|
|
|
Hi!
thanks for help, it solved my problem and now my application is running perfectly...I just had to make a small change in your given code:
Ian Shlasko wrote: In frmSplash_Load (Or wherever you want to do the actual work):
_mainForm = new frmMain();
...
this.Hide();
"this.Hide();" was not allowing the "frmMain main = splash.GetMainForm();" to execute, it was not returning control to Main(), i replaced it with "this.Close()" and now it is working fine....
Thanks again...Take Care, Cheerz,
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|