|
The solution is surprisingly simple. Don't draw on the Panel surface. Draw to a Bitmap object that same size as the panel. Set the BackgroundImage property of the panel to the Bitmap. now, when you draw on the Bitmap, just call Refresh on the Panel.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your reply.
Do you think the issue is on the "drawing"????
I think it is on the reading data from test equipment.
when i moving(or other actions) form.at the time i am releasing left mouse,the data readed from test equipment is null.
So i think the issue is between timer_elapsed event and communicating between pc and test equipment.
when i am doing form events,the communication will not happen.but the timer is going on. So the fucntion tesle() returns value 0.Here the problem is.
and also,i have a test.i set the timer.interval to 300 or more.the problem will not happen.
And now if it as i am saying.How can i resolve it.
Best gardness!
ICQ:258-235-734
MSN:msnadair@hotmail.com
-- modified at 21:07 Thursday 29th June, 2006
|
|
|
|
|
First, you're doing some drawing in a Timer event. Don't! Any drawing you do to the screen should be done only in the Paint event.
Second, you're using a Timer out of the ToolBox?? This passes its Timer Tick as an event, which is routed through the app's message pump. This means that other events can pile up VERY rapidly before the Timer Tick event, such as moving the form. Using an event based Timer isn't really a good idea.
Also, 100ms doesn't leave your code very much time to do anything. Painting can take an eternity (>100ms) if not done correctly.
While you're collecting data, draw to a Bitmap. Then you don't have to worry about painting, and repainting, old data continously. You paint your data once on the Bitmap and it'll be persisted between Paint events.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your reply heartly!
Well.i will try to do some changes as follow:
1> take the drawing action out of timer event
2> I havn't drawn graphics to bitmap before.but i will try.
By the way.what does this sentence mean?
Dave Kreskowiak wrote: you're using a Timer out of the ToolBox??
I am using the timer control from toolbox.it is a system.timer but windows.forms.timer.
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
codeadair wrote: I am using the timer control from toolbox.it is a system.timer but windows.forms.timer.
This is the Timer I was asking about. It's not the most accurate and it's event can be bogged down by other events the form has to process.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I agree with you.
And now i am using doublebuffer method.It is really very useful .
But it is going on.and now i have to work off.
I believe i could do well to resolve the problem with your help.
Thank you very much for you help.Please follow the problem.
By the way.what's your time now?
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
codeadair wrote: By the way.what's your time now?
To you, it's comming up on Saturday. I'm still on Friday morning.
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:51 Friday 30th June, 2006
|
|
|
|
|
Dave Kreskowiak wrote: Draw to a Bitmap object that same size as the panel. Set the BackgroundImage property of the panel to the Bitmap. now, when you draw on the Bitmap, just call Refresh on the Panel.
Yes.I just do as you day.
But i find a problem.when i use g.ScaleTransform(xscaletran, yscaletran) method.And then refresh the panel:me.panel1.refresh.
it will take no effect.why?Have i need to redraw all datas?
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
Where did the Graphics object (g) come from??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Where did the Graphics object (g) come from??
Graphics object (g) is a form variant.look here:
dim bmp as bitmap=new bitmap(800,600)
dim g as graphics=graphics.fromimage(bmp)
Maybe you could read my another forum question named "graphics.scaletransform() method".it describes the question clearly.
Thank you for you reply heartly!
ICQ:258-235-734
MSN:msnadair@hotmail.com
-- modified at 23:47 Monday 3rd July, 2006
|
|
|
|
|
ScaleTransform doesn't do anything until you draw something. It sets up a transform for any drawing done to the surface after the call the ScaleTransform.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: ScaleTransform doesn't do anything until you draw something. It sets up a transform for any drawing done to the surface after the call the ScaleTransform.
Yes.I think so.
And i have to redraw bitmap if i want to transform the graphic.So bitmap doesn't look very useful this time.
ICQ:258-235-734
MSN:msnadair@hotmail.com
|
|
|
|
|
Hi
We have developed a .NET application and created a package with Visual Studio setup project(MSI file). When we try to install in a fresh XP machine then we are getting the following Error Signature,
Error Signature
EventType : clr20r3 P1 : application1.exe P2:1.0.2365.35072 P3:449bf3a9 P4:system.data P5:2.0.0.0
P6:4333aea2 P7:25c3 P8:29 P9:system.data.sqlclient.sql
The same is working in a machine where we have installed lot of other softwares.
Please share with us if you have any solution. Thanks in advance.
Regards
Arunag
|
|
|
|
|
Is .NET Framework 2.0 installed in this machine???
|
|
|
|
|
|
I think the error is in the SQLServer, try no execute the program in other machin without create a installer.
If it dosn't run, i dosn't the answer, sorry.
|
|
|
|
|
Arunag wrote: Visual Studio setup project
What is the version of your visual studio .net?
|
|
|
|
|
|
How do you create an installer for your application? I mean what is the resource that you follow to create an installer for your application.
|
|
|
|
|
It's screaming about a problem in the SqlClient. Make sure that the machine your running this on has the latest MDAC installed and you should be OK. MDAC Downloads[^]
Now, that's assuming that your code is written properly...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
the error which i face is as following
Run-time error'20536'
unable to connect: incorrect log on parameters
we are using vb6 as front end and oracle9i as back end
and created reports in crystal reports
if any one can help us then please do
thanks
akhil patel
|
|
|
|
|
|
hi,
i am akhil patel and currently working on the invventory control system and i am facing the problem to populate the data from the database
im using vb6 as front end
i had created reports in crystal report
and i want to featch data from the database thorugh the coading
how can i do this?
if any one have the answer then please replay me
thanks
akhil
akhil patel
|
|
|
|
|
Hi,
Im looking for the code to implement the IFilter interface in vb.net, I have been searching for the better part of a day and have only come across a C# version. Can anyone help me out?
|
|
|
|
|
The IFilter interface of what?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|