|
In order to reduce flickering you may have to use a technique which is commonly reffered to double-buffering. What that means is that you create graphics context in the background and draw there. When you're done, you 'swap' the two graphics contexts. What that means is that you basically copy the back buffer graphics context's contents to the active graphics context.
A quick search for double buffering will most likely give you all the information that you need.
----
www.digitalGetto.com
|
|
|
|
|
I try to implement double buffer but i can't get the handle of the SetStyle method
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
VS2005 give me the error saying that SetStyle and ControlStyles is not contained in the definition of the form.
how can i get the handle on this function to use on a panel to prevent flickering?
Donkaiser
Donkaiser
|
|
|
|
|
I'm not 100% sure but I think if you want to use the standard doublebuffering that .NET 2.0 GDI+ is offering you have to implement some other functions to support it. Make sure you find a good article on that. It's not trivial at first but once you grasp the fundamentals it should be straight forwards.
Also, did you mention using the Compact Framework?! That may be the reason. Google for an example of how to implement double buffering in C# with .NET 1.0/1.1... that is not using the .SetStyle and ControlStyles.DoubleBuffer.
Good luck
----
www.digitalGetto.com
|
|
|
|
|
I have two datagrids, dgParts and a nested datagrid dgWeights
protected System.Web.UI.WebControls.DataGrid dgParts;<br />
protected System.Web.UI.WebControls.DataGrid dgWeights;
I add a blank line to the dgParts grid with the following code:
private void add_Click(object sender, System.EventArgs e)<br />
{<br />
DataTable dt = ds.Tables["Rest"];<br />
DataRow row;<br />
row = dt.NewRow();<br />
strPartNumberInputReference = txtPartNumberInput.Text;<br />
row["PartNumber"] = strPartNumberInputReference; <br />
row["DrawingNumber"]=DBNull.Value;<br />
row["DrawingRevision"]=DBNull.Value;<br />
row["DwgPath"]=DBNull.Value;<br />
dt.Rows.Add(row); <br />
dt.AcceptChanges(); <br />
dgParts.DataSource=dt; <br />
dgParts.DataBind();<br />
<br />
<br />
}
So I am trying to do the same thing for the dgWeights grid:
private void addWeight_Click(object sender, System.EventArgs e)<br />
{<br />
BindData();<br />
DataTable dt = ds.Tables["Weight"];<br />
DataRow row2;<br />
row2 = dt.NewRow();<br />
strPartNumberInputReference = txtPartNumberInput.Text;<br />
row2["weight"] = DBNull.Value;<br />
row2["wtdescription"] = DBNull.Value;<br />
dt.Rows.Add(row2); <br />
dt.AcceptChanges(); <br />
dgWeights.DataSource=dt; <br />
dgWeights.DataBind();<br />
<br />
}
However, in the debugger it says that the dgWeights is null and I get the error that is in my title description. What am I missing?
|
|
|
|
|
Hi!
I'm trying to make the image in a PictureBox tile, and I can't just use the background image property since I need to change the position of the image too, which you can't do with a background image. In other words I want an image to repeat in a PictureBox. If you can help me I'd appreciate it.
Thanks,
Martin
|
|
|
|
|
Create a bitmap the same size of the control, Then redraw your image inside it however many times you need
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I think your best bet is to override to override the OnPaint and add custom code to render the image tiled inside the picturebox.
----
www.digitalGetto.com
|
|
|
|
|
I am writing an application that basically has an sidebar and form_view_panel. This sidebar has X amount of buttons on it which correspond to loading specific forms in the form_view_panel. What I need to do is raise an event to the forms in the form_view_panel to let it know when a form change is about to occur(i.e. a toolbar button was clicked), if it(the form in the form_view_panel) wants to allow this to occur at that specific time then it responds back allowing the changing process to occur ORif it doesnt want to change at that point in time that it responds back not allowing the change to occur. So any suggestions on how to implement this using C# event handling methods. Any help will be greatly appreciated.
Thank You
|
|
|
|
|
If I understand correctly, you wanted to send a button-click event from one form to another.
First, a button-click event has to be first handled by its container form. It cannot be sent to or handled by another form. This is how event model should work.
That said, you still can notify any other forms that something interesting has happened. The simpliest (may not be beast) approach is making a callback into any interested forms from within the event handler and let them to further process the event if necessary.
Hope this helps.
Best,
Jun
|
|
|
|
|
The last thing you said is very interest...this callback seems to me to be at least a path for me to go down. Do you know have or know of any code examples?
|
|
|
|
|
Here is some pseudo code:
private void ButtonHandler(object sender, System.EventArgs e)
{
if(sender == this.buttonAdd)
{
anotherForm.AddCallback( someParameters );
}
else if(sender == this.buttonModify)
{
anotherForm.ModifyCallback( someParameters );
}
else if(sender == this.buttonDelete)
{
anotherForm.DeleteCallback( someParameters );
}
}
Best,
Jun
|
|
|
|
|
See the MVC pattern on Wikipedia.com. The Controller can be used to provide the messaging across different views so that the views remain isolated.
|
|
|
|
|
Hello!
It's not really a c# topic but I managed get my answers from this group before. And I need this for my C# application.
Can u tell me where to set default mail and VOIP client. I want to use mailto: and callto: calls from my application and for now callto: calls my Skype and I want to set other client for testing. Do u know where to set that in winXP?
Thanx
Ante
Ante
|
|
|
|
|
Start menu / settings / Control Panel / Add or Remove Program / Set Program Access and Defaults / Custom
Command and Conquer!
uh....
expand and edit!
|
|
|
|
|
thanx!
but is there any why to set callto: ? Actually I need this one more than mailto: since I'm trying to test integration of VOIP programs into my application
Ante
|
|
|
|
|
Well if you look in the registry HKEY_CLASS_ROOT
you will see there is a top level key name 'http', 'https', 'mailto', etc...
I bet there is one named 'callto'
Now I don't know what's inside. But that's the place to look in.
|
|
|
|
|
Thanx!
I'll try to use it
Ante
|
|
|
|
|
Hi
Im using VS 2005 and C# and the Enterprise Library 2.0. I want to design an application that can't be affected by the Database engine i used (SQL Server, Orcale, My Sql, Postegree) how can i acheive that since MySql and Postegree is not supported in Ado.net as
provider.
Thanks for your help
|
|
|
|
|
Cross posting??? Tisk tisk tisk....
|
|
|
|
|
there are three providers in .NET.
odbc
oledb
sql.
oledb I use mainly for Acces, Oracle and sybase connections. The odbc I used once for a DBase V database. Sql is for the Sql server.
What you probably need to do is find the connection string for either the oledb or odbc providers.
oledb is not possible for older databases (like Dbase V) but is faster then odbc.
Sql is the fastest, but will only work with Sql Server.
Hope this helps.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
|
Hi! Recently I have bumped into a problem which I never have had before.
I've got an object which have a couple of onChange events,
I am doing some clones of this object and I really need to "copy" the events that the original object had into the new ones.
Anyone who can help me
Thanks
//
Daniel
|
|
|
|
|
1. make a subclass and call base.MemberwiseClone()
2. serialize then deserialize (caution, it would be a deep copy)
3. Use reflection to call the protected MemberwiseClone() method (requires full trust)
|
|
|
|
|
Thanks for your answer, I implemented it using MemberwiseClone() easiest right now and I think it will do.
But if for some reason any of you have got a nice way to show ... please feel free to do so.
|
|
|
|
|
I have a compiled DLL by VC6.0, in with:
<br />
<br />
#include "argedit.h"<br />
<br />
#include "allocpool.h"<br />
<br />
<br />
<br />
template <class Node, class Edge><br />
<br />
<br />
class StreamARGLoader: public ARGEdit<br />
<br />
{ public:<br />
<br />
typedef Allocator<Node> NodeAllocator;<br />
<br />
typedef Allocator<Edge> EdgeAllocator;<br />
<br />
<br />
StreamARGLoader(NodeAllocator *nalloc, EdgeAllocator *ealloc, <br />
<br />
istream &in);<br />
<br />
<br />
static void write(ostream &out, ARGraph<Node, Edge> &g);<br />
<br />
static void write(ostream &out, ARGLoader &g);<br />
<br />
<br />
private:<br />
<br />
<br />
enum { MAX_LINE=512 };<br />
<br />
void readLine(istream &in, char *line);<br />
<br />
int readCount(istream &in);<br />
<br />
void readNode(NodeAllocator *alloc, istream &in);<br />
<br />
void readEdge(EdgeAllocator *alloc, istream &in);<br />
<br />
};
instruction file :
<br />
int main()<br />
{
NewAllocator<Point> node_allocator;<br />
NullAllocator<Empty> edge_allocator;<br />
<br />
ifstream in("graph.txt");<br />
<br />
<br />
StreamARGLoader<Point, Empty> loader(&node_allocator, <br />
&edge_allocator, <br />
in);<br />
<br />
ARGraph<Point, Empty> graph(&loader);<br />
<br />
And finally hihi i don't know how to using it in C#, i face problem about NodeAllocator and istream &in
Is this "StreamARGLoader" a void or a function?
[DllImport("GraphMatching270606.dll",
EntryPoint="StreamARGLoader",CharSet=CharSet.Auto)]
public static extern void StreamARGLoader(NodeAllocator *nalloc, EdgeAllocator *ealloc, istream &in);
|
|
|
|