|
Just use double buffering, then all your flicker will be gone. I beleive its as simple as:
this.DoubleBuffer = true;
or something like that.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Hi, thanks,
however, it does not work, where should I put this command? in the Paint() function or somewhere else?
|
|
|
|
|
Have you tried SuspendLayout and ResumeLayout ?
SuspendLayout on mousedown and resume on mouseup.
If it' stuck, DO NOT pull harder!
|
|
|
|
|
I plot in a panel, if you set: this.DoubleBuffered=true, it can be effective for the panel?
I have tried SuspendLayout and ResumeLayout , it does not work either.
because the lines and rectagule are both updated simutaneously in the paint() function. How can I update the rectagle lines without updating the lines?
|
|
|
|
|
Hi,
I just tried to plot in a panel, it does work!
I think now the problem is: if I plot in a panel, how to do it.
thanks a lot
|
|
|
|
|
i dont understand your question.
can you post some code?
If it' stuck, DO NOT pull harder!
|
|
|
|
|
sorry, I mean if I plot in a form, it does work, but if I plot in a panel (I use splitcontainer) how to make it work.
///////////////////////////////////////////////////////////////////////////////////
for example: plot in a form: (it works)
using System.Drawing;
using System.Drawing.Drawing2D;
namespace GDI__Test
{
public class Form1 : Form
{
private GraphicsPath _oShape;
private Pen _oPen;
private SolidBrush _oBrush;
public Form1()
{
base.SetStyle(ControlStyles.DoubleBuffer, true);
base.SetStyle(ControlStyles.UserPaint, true);
base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
_oShape = new GraphicsPath();
_oPen = new Pen(Color.Black, 2.0F);
_oBrush = new SolidBrush(Color.Yellow);
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
_oShape.Dispose();
_oShape = new GraphicsPath();
_oShape.AddEllipse(e.X, e.Y, 100, 150);
_oShape.CloseFigure();
this.Invalidate();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics loGraphics = e.Graphics;
loGraphics.SmoothingMode = SmoothingMode.AntiAlias;
loGraphics.FillPath(_oBrush, _oShape);
loGraphics.DrawPath(_oPen, _oShape);
}
}
}
////////////////////////////////////////////////////////////////////
//plot in the panel: (it does not work!)
...
private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e) {
Graphics loGraphics = e.Graphics;
loGraphics.SmoothingMode = SmoothingMode.AntiAlias;
loGraphics.FillPath(_oBrush, _oShape);
loGraphics.DrawPath(_oPen, _oShape);
}
|
|
|
|
|
hi.. i had a chance to try this.
change
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
_oShape.Dispose();
_oShape = new GraphicsPath();
_oShape.AddEllipse(e.X, e.Y, 100, 150);
_oShape.CloseFigure();
this.Invalidate();
}
to
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
_oShape.Dispose();
_oShape = new GraphicsPath();
_oShape.AddEllipse(e.X, e.Y, 100, 150);
_oShape.CloseFigure();
splitContainer1_Panel2.Invalidate();
}
and use the splitcontainer mousemove method.
but then it flickers since there's no setstyle on the panel.
If it' stuck, DO NOT pull harder!
|
|
|
|
|
thanks a lot.
I found the solution for panel:
public class DoubleBufferPanel : Panel
{
public DoubleBufferPanel()
{
// Set the value of the double-buffering style bits to true.
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
this.UpdateStyles();
}
}
then and a new DoubleBufferPanel to the current panel, then plot everyting on this new panel, it works.
|
|
|
|
|
Dear All,
I can enable/disable(install/uninstall) serial port through device manager. But I have to do it
through programming . How can i do that in C#? Please help.
Thanks in advance
Nasif
|
|
|
|
|
I haven't checked it but a good start would probably be connecting to the management console. Apparently there is a new MMC class in .Net 3.0
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Hi, I posted the following mesage to a wrong forum earlier. Hope you can forgive me. Here is the re-post:
I tried to find an answer for while but could not get one. Here is the code to send ONE email:
MailMessage mail = new MailMessage();
mail.From = SenderEmail;
mail.To = RecipientEmail;
mail.Subject = "My Subject";
mail.Body = "My Message";
SmtpMail.SmtpServer = "MyServer";
SmtpMail.Send(mail);
mail=null;
However, if you want to send the email to thousands of each individual email address, do you place the loop outside of this code block or inside?
if outside, the mail object is created and destroyed in every loop:
for (int i=0;i<10000;i++)
{
RecipientEmail=GetEmail(i);//retrieve an email address
MailMessage mail = new MailMessage();
mail.From = SenderEmail;
mail.To = RecipientEmail;
mail.Subject = "My Subject";
mail.Body = "My Message";
SmtpMail.SmtpServer = "MyServer";
SmtpMail.Send(mail);
mail=null;
}
if inside, the mail object is created once:
MailMessage mail = new MailMessage();
for (int i=0;i<10000;i++)
{
RecipientEmail=GetEmail(i);//retrieve an email address
mail.From = SenderEmail;
mail.To = RecipientEmail;
mail.Subject = "My Subject";
mail.Body = "My Message";
SmtpMail.SmtpServer = "MyServer";
SmtpMail.Send(mail);
}
mail=null;
Which is the proper way or does not really matter?
Thanks,
TOMZ_KV
|
|
|
|
|
I feel i've seen this before...
Why not try:
MailMessage mail = new MailMessage();
mail.From = SenderEmail;
mail.Subject = "My Subject";
mail.Body = "My Message";
SmtpMail.SmtpServer = "MyServer";
for (int i=0;i<10000;i++)
{
RecipientEmail=GetEmail(i);//retrieve an email address
mail.To = RecipientEmail;
SmtpMail.Send(mail);
}
mail=null;
Assuming that the subject, message, and server all stay the same.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
|
May be its a website with thousands of members...
I just supported spam e-mails didn't I?
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
The Undefeated wrote: I just supported spam e-mails didn't I?
Yeah, I think you did.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Generally, you should put as many recipients as you can into the same message so that servers can make use of single-instance storage and reduce the amount of traffic sent. The SMTP specification (RFC 2821[^]) requires that SMTP servers accept at least 100 recipients per message. However, some sites now only accept lower limits (notably Hotmail). Intermediate servers can generally cope with splitting a message where there are too many recipients at a receiving site. A SMTP server set up to deliver mail on your behalf - often called a 'smart host' - will perform separate SMTP connections to each receiving site, if there is more than one receiving domain in the recipient list.
If you don't want the recipients to see the list of users that the message was sent to, use the Bcc field.
The System.Web.Mail namespace wraps the CDOSYS library. I think it's OK to add as many addresses as you like in a single message up to the limit configured in the SMTP server you send to, which will in turn split the message into multiple messages as required for each server it talks to, if that server's recipient limit is reached. You'll have to find out the limit from the administrator of your server.
System.Net.Mail classes (e.g. SmtpClient) do the SMTP conversation directly in .NET code if you set DeliveryMethod to SmtpDeliveryMethod.Network (saving a heck of a lot of COM Interop chatter). In this case, if you specify more addresses than the receiving server can handle, you will get an SmtpFailedRecipientException (if only one failed) or an SmtpFailedRecipientsException (more than one). Cases where it failed because too many recipients were specified should appear with a StatusCode of SmtpStatusCode.InsufficientStorage (452), but might appear as ExceededStorageAllocation (552).
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
i am trying to create an activex control using C# that allow me to drag and drop items from desktop on it for file upload ,but i'm having a problem, i can't register the control ,if anyone can help me register the activex control using c# code ,plzzzz help
thanks.
Maya
|
|
|
|
|
for those who brilliant in C#..please help me wit tis program?
Create a simple calculator using overloading operator?how to create simple arithmetic operation wit addition,subtraction,multiplication and division...
Using array n structure,create a calendar frm the month of JAN until DEC
user enter any month, the number of days should be display according to the month typed-in
please i need help..i'm not lie..i need it for my project,any ideas of method tat u alls can help me..
-- modified at 7:49 Wednesday 24th October, 2007
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Mohd. Firdaus wrote:</div>please i need help..i'm not lie..i need it for my project,any ideas of method tat u alls can help me.</blockquote>
Well done for telling the truth, but im afraid I dont think anyone will complete your homework for you.
However, we're happy to help - you just need to show us that you've at least made an attempt yourself and have a specific coding problem. When you do, post the code along with a description of the issue you are having and we'll do our best to guide you.
Good luck... get coding.
---
How to get answers to your questions[^]
|
|
|
|
|
Read a good book about (C#) programming.
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.
|
|
|
|
|
my dear student mr. Mohammad Firdaus!
this is Professor Ulhas from university. I tell my students including u specifically that you must no post homowork on the codeprojectiles. now i'm witnessing with my own eternally saddened eyes u ignorning my warnings and dismissings my cumings, u posted homosexworks on the code projectians!
u eternally sadden me with deep melancholy. curses of shiva on you! black grade now and forever. expel u from university! i want to tear my eyes out and squish them under foot becuz u made me so saddened with ur posting homoworks on the cepian web sight. no more sensual favors for u. u will be exorcised and expelled u devil!
Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas
|
|
|
|
|
This was marginally funny the first time you did it - now you're just trolling.
|
|
|
|
|
hello please lah wei...be practical?i just ask help or guide ok not to ask the whole things?i am in begineer stage of cuz need help..dun simply judge ppl lah...if ur are the professor be moderate okeh?if dun wan help just say cannot help...if not just guide me..thanks for urs reply coollzzzz
|
|
|
|
|
Hi,
I want to drop text to a textbox via drag'n'drop.
basic drag'n'dropping is no problem but I want to insert the text at a specific cursor position, that changes with the mouse cursor like selecting text in MS Word and moving it around an drop it between other text passages...
Is this generally possible and how?
greetings
|
|
|
|