|
Normally not. But if you have access to the Document which is printed you could check its PrintController property. This one should have different types depending on the output destination.
|
|
|
|
|
I need Help!
How would I go about adding values and subtracting values from each other? Example: I have 100 stock, I assign 50 to store A and 10 to store B now the amounts should be added and displayed in store A and B and then they must be subtracted from Stock.
Any help would be welcome. I am using C# Express.
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
If you start using variable to do your computation even, dare I say, temporary variable, it all start to make sense.
for example:
in basket A you have na apples.
in basket B you have nb apples.
you take p apple from basket B and put them into A.
what happen?
we write it like that:
na = na + p;
nb = nb - p;
does it shed some light?
|
|
|
|
|
Yes it does!
One more question, How would I specify this in a class and should it be best to specify this in a class of it's own for usability?
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
hu?
you mean something like that?
class MyStore
{
int appleCount;
int berryCount;
public void EatSomeBerry(int n)
{
if(n > berryCount)
throw new ArgumentOutOfRangeException();
berryCount -= n;
}
///
/// abracadabra
///
public void TransformSomeBerryIntoApple()
{
Rand r = new Random();
int n = r.Next(100);
EatSomeBerry(n);
appleCount += n;
}
}
tss... it's not good to miss your lesson
|
|
|
|
|
Hi folks ,
now i have work with live video capturing and audio capturing in the windows forms, this application have more number of images and designs so it takes more time and also it take much more time to respond , i need to reduce the time
did you know plz share with me........
Best Regards..
ranandbe
-- modified at 1:31 Wednesday 10th May, 2006
|
|
|
|
|
Use a seperate thread for the video and audio capture (if you aren't already). This will free up the GUI thread, and should improve response time.
|
|
|
|
|
Hi,
Thank you, already i done with different thread's,my problem was application loading(form loading) time is high,i think the problem was in large size pictures and some code is in form load event but no way to change that picture as well as code is there any way to improve the form loading as quick.
best regards
ranandbe
-- modified at 4:53 Wednesday 10th May, 2006
|
|
|
|
|
Development Environment: C#/VS2005
I have an interface for doing a time consuming back end operation,
the caller is a GUI program, I want to inform the caller that % of job
completed in frequent intervals.(say for example 25%, 50% and 75% completed).
With event can we achieve this? That is event will be raised from the
interface and caller will wait for the event? Any ideas or Sample code?
Regards
Sarma
|
|
|
|
|
Stop flooding !!!
Best regards, Alexey.
|
|
|
|
|
Why do people always assume the worst, namely that this guys is flooding on purpose?
He probably sent it, saw that his message was not shown and then sent it again - without realizing that maybe his proxy was the culprit.
Is it really that hard to stay polite and friendly?
Why don't you simply write "You accidentally posted this twice." instead of
" _STOP_ _FLOODING_ !!!1!!1 one exclamation-mark eleven !".
You are gonna have a heart-attack before thirty, mark my words.
Oh, and a few things to consider:
a) That any reply will never stop anyone who has his mind set to flood a BBS.
b) Being unfriendly might actually hurt someones feelings.
c) If he was a troll, you would have given him reason to continue by getting emotional.
SEB
--
Contra vim mortem non est medicamen in hortem.
-- modified at 1:49 Wednesday 10th May, 2006
|
|
|
|
|
Sebastian Schneider wrote: Why don't you simply write "You accidentally posted this twice."
More than twice, and same problem with different header.
I call this "flooding", how about you ?
And, finally - he can delete thess messages after "multi-posting", but he don't do that.
Anyway, respect to you. I agree with your "polite" opinion.
Best regards, Alexey.
|
|
|
|
|
public delegate void OnMyEvent(FiresMyEvent sender);
public class FiresMyEvent : System.Windows.Forms.Control
{
public event OnMyEvent MyEvent;
protected override void OnClick( EventArgs e)
{
if( null != MyEvent)
MyEvent( this);
}
}
and yes "Stop flooding"
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Development Environment: C#/VS2005
I have an interface for doing a time consuming back end operation,
the caller is a GUI program, I want to inform the caller that % of job
completed in frequent intervals.(say for example 25%, 50% and 75% completed).
With event can we achieve this? That is event will be raised from the
interface and caller will wait for the event? Any ideas or Sample code?
Regards
Sarma
|
|
|
|
|
Development Environment: C#/VS2005
I have an interface for doing a time consuming back end operation, the caller is a GUI program, I want to inform the caller that % of job completed in frequent intervals.
(say for example 25%, 50% and 75% completed) . With event can we achieve this?
That is event will be raised from the interface and caller will wait for the event?
Any ideas or Sample code?
Regards
Sarma
|
|
|
|
|
skrishnasarma wrote: With event can we achieve this?
Yes.
Best regards, Alexey.
|
|
|
|
|
Then how we achieve this?
|
|
|
|
|
As you say:
event will be raised from the interface and caller will wait for the event
But, from class of this interface, not from interface.
Best regards, Alexey.
-- modified at 0:57 Wednesday 10th May, 2006
|
|
|
|
|
Thanks Alexey, Shall I get any sample code on this?
|
|
|
|
|
|
I have to do some WYSIWIG rendering.
Because I need to know exactly where is what and have to have the same output on both the screen and the printer I decided to change my Page unit to Inches.
As I was testing my first thought was to draw red outline of some relevant rectangle.
And here I had my 1st encouter with those infamous Windows strangeness....
Even though I had set my line width to 0, GDI+ draw 1 inch thick rectangles...
What's that?
How could I fix that?
Below is a code sample showing the problem,
just try it: big rectangle:
==========================
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.PageUnit = GraphicsUnit.Inch;
using (Pen pen = new Pen(Color.Red, 0))
{
pen.Width = 0;
e.Graphics.DrawRectangle(Pens.Red, 0, 0, 8.5f, 11);
e.Graphics.DrawRectangle(Pens.Red, 1.5f, 1.25f, 5.5f, 8.5f);
}
}
|
|
|
|
|
Never mind, obvious bug in my code.... :->
|
|
|
|
|
Hi,
If two interfaces have a method of same signature and If we inherit both the interfaces in our class,what happens!
Thank you!
Deepa,
Be the Change you want to see!
|
|
|
|
|
You must describe methods evidently, for example:
<br />
public void IInterface1.Method1()<br />
{<br />
<br />
}<br />
<br />
public void IInterface2.Method1()<br />
{<br />
<br />
}<br />
To call one of this methods, you must cast your class for requered interface:
<br />
((IInterface2)myObject).Method1();<br />
But, you must avoid this situation.
Best regards, Alexey.
|
|
|
|
|
Does anyone know how to build a sudoku game with c#? i really want to make a PC sudoku game! If noone knows how to make one with c# does anyone know any other language i can use? Thanks!
|
|
|
|