|
that already work.
VNC is not open source.
|
|
|
|
|
Yanshof wrote: VNC is not open source.
Tight VNC is OSS. It's not the most efficent implementation outthere but it works.
http://sourceforge.net/projects/vnc-tight
|
|
|
|
|
You may also want to look at fogcreek copilot[^]which is a commercial project built upon the tightvnc core.
ChrisB
|
|
|
|
|
I have a large treeview I need to build and it takes about 1 minute to load. what I'd like to do is load the treeview in background. I tried doing it through, but it causes the main form to freeze until it's complete. Does anyone know what the best process is to load things in the background not affecting the main application screen.
Thanks.
|
|
|
|
|
Hi
Use System.Threading to Perform your request (Loading Treeview)
Good Luck
|
|
|
|
|
Or even easier (if you're using .NET 2.0) is to drop a BackgroundWorker process onto the form. It's DoWork event will fire a method on the form where you can do your processing.
Be warned however, that Windows Forms aren't thread safe, so any manipulation of the form controls requires jumping back onto the main thread using Control.Invoke or Control.BeginInvoke to call a delegate. Eg.
<br />
public partial class MyForm<br />
{<br />
delegate void AddItemDelegate(string text);<br />
<br />
private void AddItem(string text)<br />
{<br />
if (InvokeRequired)<br />
{<br />
BeginInvoke(new AddItemDelegate(AddItem), new object[] { text });<br />
return;<br />
}<br />
myListBox.Items.Add(text);<br />
}<br />
<br />
private void myListBox_DoWork(object sender, DoWorkEventArgs e)<br />
{<br />
foreach( string item in myList )<br />
{<br />
AddItem(item);<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hi,
I have a dialog box where the user can edit some fields. I need to display an error message if some fields have wrong data when the user clicks OK, and I'd like to keep the dialog open, so they can change those fields.
How can I do that?
thanx
|
|
|
|
|
I'm assuming that you're using ShowDialog() to show the form and have set the ok button to give a DialogResult.OK. In which case, remove the dialogresult from the ok button, execute code to check and display error message. If no error message is displayed, set the form.DialogResult = DialogResult.Ok in code. Then close the form.
ChrisB
|
|
|
|
|
|
Hi,
How can I restrict to single instance for my running application on Windows ?
Is there any easy snippet to do that ?
Thanks
|
|
|
|
|
|
put this in your code
static bool InstanceExists
{
get
{
bool notExists;
mutex = new Mutex(false, "Local\\" + AppGuid, out notExists);
return !notExists;
}
}
static Mutex mutex;
static string AppGuid = "";
and we can check if the program is running...
if (!Program.InstanceExists)
{
}
|
|
|
|
|
Is there any way to send some text to this textbox ? (It's actualy named "TRichViewEdit")
I tried this code
ApiStuff.SendMessage(hWnd, WM_SETTEXT, 0, "text");<br />
but nothing happens
I'm sure that hWnd is right, because I could get text from textbox.
Some sources in C# and/or using WinAPI would be very useful
|
|
|
|
|
Said textbox might not accept WM_SETTEXT message, have you varified whether is it accepting this message?
you can you spy++ or winspy like utilities to do that
|
|
|
|
|
Hmm, looks you're right.
This textbox isn't accepting WM_SETTEXT..
So another question is raised, is there other way to change its caption ?
|
|
|
|
|
hi
i found an article in codeproject as DataGridPrinter that print datagrid good. but it has written with VB.Net and i want it in csharp. when i create dll in VB.Net and i use it in c# the following error shown me :
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'
and when i set Datagrid1.DataSource = ds1.Tables["Table1"]; the following error shown me :
//in Line 374
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
how to solve my problem and do you have a other class that print datagrid in C# with header and footer ?
thanks ..
|
|
|
|
|
Sorry for the long post, but please bear with me.
I have a graphics user control that can display several graphics primitives, plus bitmaps and text in 2D. Users can easily scroll/pan/zoom, select objects and scale or move them, and is used all over my organization (for a visual, one of the uses is to overlay CAD information on top of a bitmap). The graphics objects are also used outside of the context of drawing - some applications only use the objects themselves to do calculations for other purposes.
Each object implements an interface and most manipulation of the object is through that interface. Each object draws itself using a supplied System.Drawing.Graphics object like a ton of articles on code project and elsewhere suggest. The current design works great for collections of graphics objects up to about 3,000 or so, but now the control is being used in situations where there may be 30k+ objects in the drawing and performance is very poor.
I've been going over the code and looking for optimizations, and there are several things I'm going to work on, but one of the things I also want to try is using different graphics for drawing, perhaps Managed DirectX, but here lies a problem. The interface that each object implements includes 3 methods that need a System.Drawing.Graphics object as a parameter. One of the methods is Draw(), the other two are for determining the size of a shape (which is really only needed for text objects - ie. MeasureString - but had to be in the interface to keep things generic). So basically, I need a way to decouple the actual drawing method used from the object itself.
One idea I had was to create a separate GraphicsContext object that would be passed into the objects in place of System.Drawing.Graphics and would have methods similar to System.Drawing.Graphics, but could be implemented behind the scenes in whatever way I wanted. The problem with that is I'm simply coupling to something else - and the users who don't even use the objects as "graphics" have yet another thing to use for determining size (unless I can figure out a way to measure a string without some type of graphics). Maybe I'm just over-thinking this one.
Another idea I had is to completely remove the graphics requirement for all methods and remove the Draw method entirely, then only the drawing code itself would be coupled to a specific method. This has worse problems though - users can currently add their own graphics objects, but this method would not know how to draw those. Plus the performance probably wouldn't be there anyway - the collections only expose the objects as the interface, so it would require checking and casting to specific types before the drawing. The Con's pretty much make this a no-go.
Are there other ways I can do this? I know there has to be, I know of many games that work with DirectX or OpenGL and some even software render if those aren't available, so there must be some good way of doing this. I once saw an article about this when Googling for something else, but I'll be damned if I can find it now.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
How about something like a PrimitiveInformation member for each object which basically contains polygon, color and type information? (Something like a Vector4 struct).
This would allow for a parameterless Draw function. Instead, each renderer (DirectX, OpenGL, System.Drawing) would just pull the PrimitiveInformation and Draw it the way it does.
DX, OpenGL and System.Drawing all can easily parse basic information like polygons, colors etc.
Something like this:
interface IDrawableObject
{
ObjType type;
Vector4[] polygons;
Vector3 translation;
Vector3 rotation;
public void Draw() { ... }
}
This could be easily used with any renderer.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You need to see Adapter design pattern. It helps you work with two different interfaces (system.drawing and directx) which is not otherwise possible because of incompatible interfaces.
For more information about adapter design pattern click here. http://www.dofactory.com/Patterns/PatternAdapter.aspx[^]
|
|
|
|
|
It took me a while to figure out how I could apply this, but I think I have it now. It's basically what I was thinking already, but one step forward so that the user doesn't need to worry about the graphics at all, it will be done fully inside the object.
Thanks a bunch.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Hy, i need some help because im pretty lost
ok, the thing is that i have to make a program that takes all dlls in a folder, read them and take those classes, methods and properties. Then it writes on a XML, f.e.:
-<global>
-<string>
<method/>
<property/>
-</string>
</global>
well, at start i thoght it was easy, but as i go further i find more problems.
My msn is sgermey@hotmail.com, im connected almost all day
Thanks all for read/answer/help/whatever
|
|
|
|
|
I have a problem in that MS SQL 2000 can't access a database I use (Sybase Adaptive Anywhere). However, Visual Studio can access it (well, the tables I have permissions granted to select). I need to extract the data from tables and put them into a new database and/or datawarehouse.
1. Is there an efficient way of duplicating a database in C#?
2. What's the best way of creating / populating an OLAP cube? I would like to use SQL Stored Procedures to copy data from the db into the OLAP cube with a schema. As this is not possible, do I import data into C#, use a table adapter to make new table designs and then put it into the OLAP cube? Would it be better to duplicate the database and then use SQL stored procedures?
Thanks for your help in advance.
|
|
|
|
|
I thought that enterprise manager could access data in most data sources.
You may want to look at data transformation services - create a local package, there are a load of database connection types (inc. odbc). You write all your scripts to transfer the data in the local package (you may need to read up on the it, but essentially you drag and drop tasks (eg there's an execute sql task), hook events together and the run in sequence based upon the previous events success or failure.
You can then schedule the package to run periodically (we run it overnight to populate our olap cube) using sql server agent.
Hope that helps (although it's not a c# solution).
ChrisB
|
|
|
|
|
Hi!
I have a textbox where I write my namn and click OK. Then a another form loads up.
Then my name should appear in a label. But I cant seem to reach my variable (name) from form1 to use it in form2.
Any suggestions?
Newbie untill I die!
|
|
|
|
|
Hy,
The easiest way to do what you need is to create a public static variable that contains the TextBox's text. I'll give you an example code. Suppose you have Form1 with TextBox1 and Form2 with Label2. When you click Button1 from Form1 you show Form2 with the text on the Label2.
public static string textBoxText = "";
private void Button1_Click(object sender, EventArgs e)
{
textBoxText = TextBox1.Text;
Form2 f = new Form2();
f.ShowDialog();
}
private void Form_Load(object sender, EventArgs e)
{
Label2.Text = Form1.textBoxText;
}
Hope it helps you.
Do your best to be the best
|
|
|
|