|
Only the main thread can update an item on a form.
|
|
|
|
|
Hi,
in .NET 1.x you could try it from another thread and it might work (most of the time),
or it could result in forms with a white menu bar on top (I'm sure you have seen these
already, even on non-.NET code).
in .NET 2.0 and up it gets rejected by default; you must set it up in such a way that
all controls get handled completely by the thread that created them, often called "the UI
thread" or "the main thread".
For some simple examples, look at either one of my articles.
Luc Pattyn
|
|
|
|
|
I need to Mime encode a jpeg to stick it in a database that is normally used by an ASP app so it stores the MimeType and MimeString. I'm writing a winforms app. Everything I've found so far encodes into a mailmessage or http stream but I can't see a way of getting the data back out
Any help would be greatly appreciated.
Thanks,
Russell
|
|
|
|
|
i wnat now whether javascript can be used by asp controls
or not
i have many validations to be done on client side and need to carry them to cs file what should i do....
for this
thanking u
|
|
|
|
|
use the attribute Runat = Server in all the controls if you want to carry them to CS file.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|
|
thanks a lot dude....
bye
|
|
|
|
|
I am facing a very rigid problem. Project requirement is to integrate NUNIT with Crystal Reports and then write NUNIT Test cases for each Crystal reports designed... Please help me in integrating NUNIT with Crystal Reports And afterwards in writing NUNITs for the same
Harshal M Nemade
|
|
|
|
|
Hello,
Is there a way to detect that the pc monitor is going in standby mode in C# 2.0 with windows XP.
I have tried to detect WM_POWERBROADCAST and registerPowerNotifications (Vista only feature so it didn't work). Thanks for any suggestions .
|
|
|
|
|
When I was at the Detroit launch event in the developer track, the presenters said that their was no way to tell of different power setting changes in Windows XP. They did however mention the WM_POWERBROADCAST event for Windows Vista and how it could be used within gadgets/applications.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
We need to validate an expression which contains all the arithematic operators, conditional operators, logical operators, grouping such as '()' and '{}'
For example:
A+B = 10 AND (B*C)/d = 56
Thanks in advance
|
|
|
|
|
This sounds very much like homework to me, but I might be wrong...
Internet - the worlds biggest dictionary
|
|
|
|
|
hi, can anyone help me how to set up DirectSound buffer notification points? im trying to use a streaming buffer and i wanted to set notification points to know if the buffer is almost full..
mumwei
|
|
|
|
|
Hello Friends,
I want to implement socket client project.
I want only one server and any number of clients.
Please suggest me something which will work faster.
Is it possible to communicate on same port.
Please help me fast.
Thanks in Advance.
Rahul Kulkarni
|
|
|
|
|
RahulRKulkarni wrote: Please suggest me something which will work faster.
Faster than sockets? Everything will go through a Socket eventually so you are already at the lowest level of abstraction for an application. If you want to get really down and dirty you could write an NDIS driver and manipulate the packets directly as they pass through your network card.
I would like to suggest that sockets are probably not your problem. Perhaps they way you are interacting with sockets is the problem. Perhaps the protocol you invented to sit on top of TCP/IP is inefficient.
RahulRKulkarni wrote: Is it possible to communicate on same port.
The client and server will have their own ports. The server will listen on the same port for all clients. What port the client receives data on can be the same or different. If one client machine can open several connections then the client will have to use several ports.
|
|
|
|
|
Hi,
I want to know how to display the files on the web page that is uploaded for downloading later one by one.Each of this file should be password protected.Can I use data grid?Can you please give the coding.The coding is to be in C#.And the db is MS-Access.Very Urgent.........
-- modified at 1:53 Friday 16th February, 2007
Regards,
Sharon.A.
|
|
|
|
|
i am currently trying to create a program that takes screen coordinates on a panel and on click stores that information in memory then continues the line from the last click. Basically creating a polyline.
I have been looking thru the forums and got these snippets of code:
mark1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseUp);
mark1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseDown);
mark1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Mark_MouseMove);
I ran the entire source that contained the above snippets and they produced effects similar to what i want.
So can anyone give advice on what to do or where i can go for source code similar to what i want?
oh btw the above snippet came from Drawing and Editing Lines with GDI+
By Butch.er. somewhere on this site.
ghost_uwi
|
|
|
|
|
I did this yesterday, apologies if i missed any snippets
Instance variables:
LinkedList<LinkedList<Point>> _lineDrawings = new LinkedList<LinkedList<Point>>();
LinkedList<Point> _currentDrawing;
Mousedown:
_currentDrawing = new LinkedList<Point>();
_lineDrawings.AddLast(_currentDrawing);
MouseMove:
if ((e.Button & MouseButtons.Left) > 0)
{
_currentDrawing.AddLast(new Point(e.X, e.Y));
}
Paint Method:
foreach (LinkedList<Point> pointList in _lineDrawings)
{
if (pointList.Count != 0)
{
Point LastPoint = pointList.First.Value;
foreach (Point point in pointList)
{
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Red)), LastPoint, point);
LastPoint = point;
}
}
}
Undo Method:
_lineDrawings.RemoveLast();
pctMainView.Invalidate();
Hope there's something in there to help you
Russell
PS sorry about the formatting, i don't seem to be able to get generics working without ticking the ignore HTML tags tickbox
-- modified at 3:39 Friday 16th February, 2007
|
|
|
|
|
I've just realised that when i read your post the first time I missed the bit about poly line. Unfortunately i don't have any code to do that but i'll take a stab at some ideas.
Create a line struct with a start and end point as properties.
Create an instance variable: LinkedList<Line> _lineCollection where Line is your struct.
Create another instance variable: Line _currentLine
Create another: bool _drawing
On the first click create a line with start and end at the samepoint and assign it to _currentLine, add this object to _lineCollection, also set _drawing to true.
On move:
Check if _drawing == true
set _lineCollection.Last to the current mouse position
Invalidate the drawing surface
SecondClick set endpoint of _lineCollection.Last to the Mouseposition and create a new line as before assign to _currentline etc.
In the Paint method of the form:
use a foreach loop to go through all the lines in _lineCollection
e.Graphics.drawLine(Line.Start,Line.End)
HTH
Russ
|
|
|
|
|
Ok thx for the help but the help was a bit out of my league.
I got some source code and mainpulated it a bit.
...
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Painter_MouseDown);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Painter_MouseUp);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Painter_MouseMove);
...
Point ps = new Point();
Point pe = new Point();
private void Painter_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (flag_mouseclick == 0)
{
ps.X = e.X;
ps.Y = e.Y;
flag_mouseclick = 1;
}
pe = ps;
}
private void Painter_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
Form thisform = (Form)sender;
Graphics g = thisform.CreateGraphics();
Pen p = new Pen(Color.Blue, 2);
g.DrawLine(p, ps, pe);
ps = new Point(e.X, e.Y);
g.Dispose();
}
protected void Painter_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
Form thisform = (Form)sender;
pe = new Point(e.X, e.Y);
}
the above works around where i wanted it to.
But thx for the help none the less.
-- modified at 11:53 Friday 16th February, 2007
|
|
|
|
|
Can the Microsoft chart control take row values as double? If so how?(Any code example). And i want to plot the row values against the coloumn values.(as the coloumns contain a pointer on the chart for the specified coloumn value).
|
|
|
|
|
I am trying to search for a text in a file from my desktop whose extension i gave as .surya (Purposely) and i am not getting the results while searching as expected. But suppose i want my windows desktop search to start recognising this file extension What am i supposed to do please. I would like to have the details please to surya.raghava@gmail.com.
Surya Raghava.S
|
|
|
|
|
From within a C# application, I would like to invoke the Visual Studio command-line C++ compiler (cl.exe) to compile a simple console program (e.g., helloworld.cpp). The compiler messages should be redirected or captured to a text file.
I know the environment variables have to be set (using vcvars32.bat), but I have not had any luck in hitting on the correct sequencing and parameters for System.Diagnostics.Process methods, or the Process.StartInfo property settings. I think I'm in generally the right ball park--but maybe not.
Can anyone help?
Thanks so much,
Tom
|
|
|
|
|
I tried the following and got it working without any problems (using VS2005). I also tried it in a graphical application, storing the output in a multiline-textbox instead, without any problems. Good luck!
static void Main()
{
ProcessStartInfo psi = new ProcessStartInfo("cl.exe", " -GX c:\\hello.cpp");
psi.CreateNoWindow = true;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = new Process();
p.StartInfo = psi;
p.ErrorDataReceived += new DataReceivedEventHandler(p_ErrorDataReceived);
p.Start();
p.BeginErrorReadLine();
string sout = p.StandardOutput.ReadToEnd();
p.WaitForExit();
StringBuilder builder = new StringBuilder();
builder.AppendLine("Error:");
foreach (String s in errData)
{
builder.AppendLine(s);
}
builder.AppendLine("Output:");
builder.AppendLine(sout);
Console.WriteLine(builder.ToString());
Console.WriteLine("Press ENTER to continue");
Console.ReadKey(true);
}
private static List<string> errData = new List<string>();
static void p_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
errData.Add(e.Data);
}
Internet - the worlds biggest dictionary
|
|
|
|
|
Thanks so much for your response! Wow, I'm impressed!
Unfortunately it didn't work for me. It appears that the appropriate environment variables have to be set.
When running from within VS2005 I had to provide the whole path to cl.exe. Even then, nothing appeared after your Error: and Output: lines.
When running outside the IDE, the program complained about not being able to find mspdb80.dll.
Do you know which environmental variables should be set up [programmatically], if that is indeed the problem?
Thanks again,
Tom
|
|
|
|
|
Sorry, no. That is a question you should ask in the C++ forum instead, since it is compiling C++ you have problems with, right?
Internet - the worlds biggest dictionary
|
|
|
|