|
Try form1.Closing()
you can implement it on all the forms, there you can call Application.Exit();
|
|
|
|
|
i need to know how made a macro recorder?
i want to move the mouse cursor and click on a textBox and enter a value and so click on button!!
but computer must do this! not user!
how?
Imposible is Imposible...
|
|
|
|
|
Do you want the user to record a macro, or should the application just run a pre-recorded macro?
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
mmm...
i want the program runs the macro! but i don't know what is the macro really?
Imposible is Imposible...
|
|
|
|
|
A macro is a set of instructions, that makes the app do something.
A macro can basically do everything - move the mouse cursor, type some text,
open other programs etc.
I don't know to make a macro recorder, but I know what you can do, if the app just should do the same thing every time:
Simply just hard code the "macro", so it runs everytime the application is executed. It can take some time, but it works.
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Have a look at the Command Pattern: http://www.codeproject.com/books/DesignPatterns.asp[^]
This should give you some ideas on how to record a users actions...
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
Is there a way to add a reference from Paint.NET or something that allows me to change the properties of a picture in a picturebox? What I mean, for example, is to have pictureBox1 and int x . The example being, based on the value of x, (x could be controlled by a timer; just an example...), the pictures motion blur would raise or drop. I know this sounds like a hard concept for a beginner, but in Paint.NET there's a simple way to change it, so I figured there might be a way in C#, without exceeding memory standards... Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
You might want to consider WPF. It has a steeper learning code than WinForm (not surprisingly as WinForm is just an object oriented wrapper on a 20 year old technology that should have been replaced ages ago) but then things like this becomes trivial. Actually so trival code isn't really required - it can be done in XAML markup).
Example effects[^]
Don't mind it's a button being blured, it obviously does not matter if you apply the effect to an image, a button, a treeview, or whatever you like.
You can make individual controls in WPF and host them in WinForm applications - I tend to do this with my old projects when I can see it's easier to do a user control in WPF than in WinForm.
|
|
|
|
|
It's .NET 3.0. You will need some CTP plugins to Visual Studio 2005, or the beta release of VS2008.
While it is pretty new, the plans for it are not. There is a reason the temporary WinForm hack was stuffed into the System.Windows.WinForm namespace - it left the main namespace System.Windows free for WPF.
|
|
|
|
|
Thanks; do you know anything else, I mean, simpler, (I'm fairly new), with no downloads or anything, just a ref or something?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Nope, sorry.
Maybe being new to this is just more of a reason to go to WPF. I have been using WinForm since the betas of .NET 1.0 and unlearning the stupidity and completely outdated methodology of it is a challenge.
|
|
|
|
|
Have a read of Christian Graus' here on CodeProject about graphics and GDI+. He goes into the theory of how to do effects based graphical stuff in C#. They are very good.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hey, thanks. Do I just look at his articles?
The most knowledge doesn't mean the most wise...
|
|
|
|
|
He has source code and samples that you can download and try. Plus, he explains why he has done things the way that he has. Here's[^] the link to follow.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The core answer here is that if you want to do any sort of drawing, you should just draw directly on the form, in almost all cases. As Pete said, my image processing articles do offer a library you can free use for things like blur. Because I was trying to illustrate some core concepts with my code, I never use color matrixes, which are almost certainly a faster option for things like greyscale. You might want to also check out the source for the fotovision sample ( or paint.net ) to see if they do things in a way that's more optimised than my articles, which are designed around teaching how to write certain types of generic filter and then how to do different effects within that framework.
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 )
|
|
|
|
|
DOes anyone know a way of checking collision between a picturebox? I found a way, but I deleted it because it worked only sometime, and other let the object pass right through. I used (Something like this...)
private void CheckCollision()<br />
{<br />
int x = picturebox1.Location.X;<br />
int y = picturebox1.Location.Y;<br />
int ex = picturebox2.Location.X;<br />
int ey = picturebox.Location.Y;<br />
<br />
<br />
if ((x + 20) == ex<br />
&&
||
this.Close();<br />
<br />
}
So, my real question (I was just showing you basically the idea I had), is if there's a simpler way to do this. Thanks in advance.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Look at the picturebox1.Bounds.IntersectsWith() function.
Here's an example I made long time ago:
if (pictureBox1.Bounds.IntersectsWith(pictureBox2.Bounds))
{
MessageBox.Show("Collision!");
}
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
It's so easy! I mean, really, even for squares/rectangles, it's easy! Thanks a lot.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
You're welcome
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Do you know anything about my post above??? ^ ^ ^
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Your first post?
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
"Paint.NET"
The most knowledge doesn't mean the most wise...
|
|
|
|
|
Sorry, I don't
Virtual1ty "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"
|
|
|
|
|
Thanks anyways.
The most knowledge doesn't mean the most wise...
|
|
|
|
|
i am not sure if i am on right site. i am wondering if you can help me. i am seeking some
carrer advice/guidance from you.
i use to work in totally different industry than IT. two month
ago i have resigned my job and made up my mind to jump in to IT industry, cos i was really
bored with my previous job. so i have started studies C# lang. as i have never done
programming before. it is quite challenging for me. i m not attending any class room
course/coaching, only studying at home, cos canot afford course in UK.
As i m studying C#, i am almost at stage of finishing my book and i find it interesting.
with that i have lots of question flowing in my head. it will be great , if u could give
me guidiance on following :
1. i m alomost there to finish my book, but i just wonder there is so many concept in it
and how m gonna join all together to make software or program
2. is it possible i can pratice C# langauge , if yes then how? like through books ,
dummies project or pratice software and where can i get these stuff from which is suitable
for fresher/new commer not for people who is allready in developing software. as i m not
taking any coaching i dont have lab sessions.
3. how can i prepare myself for interview or what kind of question they ask, and how whole
interview process run?
4. should i studying any additional material to go with c#, which will help me getting job
easily in UK or which better for my carrer.
i m so soory to ask so many question bcos i am so confuse and i have no one else to ask
apart from using internet. thanks for reading my mail. i will appriciate if you could
help.
many thanks
sid
|
|
|
|