|
Thanks so much for your response. I will work towards this pointer
Ruchi
|
|
|
|
|
Is it possible in C# to create a web control which allows user to draw lines, circles, shapes etc and then save it as an image?
Thanks.
|
|
|
|
|
I think its client side working so if you use ASP.NET , you have to do a lot of client side scripting which means this part is not C#. If you want to do it all in C# it takes a lot of resource,time or postback to server which does not worth to do it.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
There is an example that does just that in the book 'ASP.NET - Second Edition'. The down side is that there is a round trip to the server with every single box or line that is drawn. It works, but is hardly what I would call 'useful'.
RageInTheMachine9532
|
|
|
|
|
What if I create a window form which does all and then use it as an activex on web page. Would that be possible?
Thanks guys.
|
|
|
|
|
AWebDude wrote:
What if I create a window form which does all and then use it as an activex on web page. Would that be possible?
As me and other CPains told you thats possible but it cause lots of round trip in the server. Using ActiveX if do all the job in the client side, then post the final result to the server is good idea.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
You'll have to write a bunch of code for drawing, repainting, and something to save. But, Visual Studio.NET doesn't target building an ActiveX control natively. Your best best for this project is to use client-side Java.
RageInTheMachine9532
|
|
|
|
|
You could use a smart client but this would require .net be installed on the users pc.
The smaller the mind the greater the conceit.
Aesop
|
|
|
|
|
You don't actually need an ActiveX control. You can create a Windows Forms user control that runs inside Internet Explorer if you find that easier. I wrote an article on this a long time ago on another site, but it has been down for a few months (and most likely is gone for good). You can find more information about this deployment scenario in the .NET Framework SDK topic, Deploying a Runtime Application Using Internet Explorer[^]. You will need to have a code access group installed on the client machine, however, in order for the control to be trusted. That is discussed as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
A Client side example: http://hem.passagen.se/tkahn/mop_eng.html#
|
|
|
|
|
I have to write a small C# form-based program which parses thru a directory containing data files. For each data file, it takes some time to process.
The problem is that with a directory with many files, my program is like frozen. The program doesn't respond to any mouse clicks or keyboard input. Worse than that, if I click on other applications, and click back to my application, the form doesn't repaint & sometimes, it repaints but Windows says that "This application does not respond" on the title bar. If I just let my application run, it will surely complete after a while.
I tried to alleviate the situation by creating a modeless dialog with a Cancel button. Before I run my lengthy task, I opened this modeless dialog. If the user clicked on the Cancel button, I set a global boolean Cancel variable, which was checked at every iteration of the lengthy task.
To my surprise, the modeless dialog didnt receive any mouse clicks when the lengthy task was in progress. So, there was no way for me to terminate the lengthy operation when it's running.
I certainly need your advice on dealing with time-consuming tasks. I guess that I would have to break down this task into several parts, but don't know how to make them run back-to-back.
Thanks a lot for your help.
|
|
|
|
|
You should do those tasks in a seperate thread. Search this site or google for this topic.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
If you want an example on how to use threads you can see:
http://www.codeproject.com/useritems/WinCount.asp
I have a program that goes thru directories and files on a seperate thread and the UI is responsive.
|
|
|
|
|
|
This is happening because the UI is being processed on the same thread as your code.Try dropping an Application.DoEvents() call into the loop that does the processing and make sure it is going to execute fairly frequently. This will cause your thread to give up control of the processor so other threads can run and other Windows can process their message queues, including yours.
The other option is to put your function that does this processing on another thread.
For an example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cssample/html/vcsamThreadingSample.asp[^]
RageInTheMachine9532
|
|
|
|
|
just create worker threads to do the background work... that way you leave the ui thread free to deal with the ui. just do a search on worker threads on google or here at codeproject.
|
|
|
|
|
Thank you so much, gurus
I haven't given it a shot, but I think that will solve the problem.
|
|
|
|
|
|
does anyone know how can i display a balloon tooltip in C# ?
thanx
shakooosh
|
|
|
|
|
|
A better example - had you searched for "balloon tooltip" on CodeProject - can be found in the article Adding Balloon Windows to a .NET Application[^]. There are other articles that uses IExtenderProvider s to provide balloon tooltips, too. Just search this site.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have been working on a custom tab control and at this poitn everything works and acts like it should EXCEPT for when you first open the designer for my tabcontrol... the designer doesnt see any of the tabs/pages that are assigned to it in the code. In order for it to see them i have to go and add another tabpage to the tabcollection, when this is done it adds the collection of pages to the tabcontrol. After thats done the designer works like it should..... its only on init of the designer that this problems happens. is there an easy way to these items at init? how does one make the init find the associated controls to the tabpage?
i have looked at Magic tabcontrol version 1.7 and pallaControls but this is just a rip of the Magic code (with a few minor changes).
perhaps just a good tutorial on creating custom ParentControlDesigner.
ps. if you would like to see some code or just more info then let me know
thanks for any info.
mb
|
|
|
|
|
perhaps its the problem is that i can not fire events from my custom TabButton control.... after i add a tabpage to my collection i then get focus on those tabpages and then can click on the tabbuttons and everything is just great.... so maybe its an issue about not setting the correct focus?
anyone?
thanks
mb
|
|
|
|
|
nevermind.... i fig it out. i just had to reinit everything from with in the designer. all fixed and working well.
|
|
|
|
|
Hello,
Here is my problem:
I made a custom button, derived from Button. Now, in my custom button I have a MyInfo struct.
I also have two forms, call them Form1 and Form2.
Form1 creates a custom button, myButton. What I want to do is pass myButtons MyInfo struct by reference to Form2 from Form1. I tried to do it like so:
<br />
f2.setInfo(ref myButton.myInfo);<br />
where myInfo is a MyInfo struct.
However, when I compile, I get something like this error:
Cannot pass 'MyButton.myInfo' as ref or out, because 'MyButton.myInfo' is a marshal-by-reference class
How can I pass my struct by reference to this other form?
Thanx for the help
-Flack
|
|
|
|