I am using VisualStudio.NET 2002 with .NET Framework 1.0 Actually i am developing a program in which i have to use Browser Control. I have used it on a control which facilitate me in providing wizard. Actually it is a wizard control on which i have used WebBrowser Control. Now i have start it both bu using Debug and without debu it is alright. Now i have created a form in which i call this wizard. Now if i run this program without using debug it will run alright but if i run it with start using debug it will give me error that cannot instantiate Active X control. What can be the problem please guide me
ThanX in advance
How do I declare a class used for utility that I do not have instantiate everytime I want to call a method from it. I have tried static this and void that, but can not seem to get it write. I know the prof mentioned it in a class I attended, but stupid me I did not write ti down.
Any class can have static methods. Just create a class (e.g. MyClass) and add static methods to it. For example, suppose you wanted a method that you'd use to strip characters off the end of a string. You might write something like:
publicstaticstring ShortenString(string s, int len)
if( s.Length <= len )
return s.Substring(0, s.Length - len);
Zembaliti wrote: Both a) and b): CanUndo always returns false, regardless the text has been modified (run-time).
According to the documentation, the TextBoxBase.CanUndo property indicates whether or not you can undo the previous operation. In both of your instances, you are not performing operations directly on the RichTextBox, but accessing two of its properties so it should return false.
I think Zembaliti is assuming that there was something in the undo buffer before these calls. As it happens, this is an acknowledged bug in the RichTextBox control. Even if the RichTextBox has changed, the act of accessing the Text property or the TextLength property completely wipes out the Undo/Redo buffer.
To work around this, you have to use the Win32 API (e.g. EM_GETTEXTEX) to get text, circumventing the Text property. If you want the Text length, you have to send the EM_GETTEXTLENGTHEX message to the control. I derive a new control from RichTextBox and override these properties to make using RichTextBox easier in my code.
You can see an example of using EM_GETTEXTLENGTHEX for this purpose on a RichTextBox in my recent article here. A google search also confirms it.
Good question. I don't have time to investigate it now, but because you can't be sure of which RichTextBox control you will be working with on the client machine (e.g. Riched32.dll or Riched20.dll), I still recommend that you derive a new control from RichTextBox and override the problem methods. You could do something like this:
public override string Text
base.Text = value;
where you define API.GetRichTextText() as:
public static string GetRichTextText(IntPtr hwndRichTextControl)
GETTEXTEX lpGETTEXTEX = new GETTEXTEX();
public struct GETTEXTEX
public Int32 cb;
public Int32 flags;
public Int32 codepage;
public IntPtr lpDefaultChar;
public IntPtr lpUsedDefChar;
private const int WM_USER = 0x400;
private const int EM_GETTEXTEX = WM_USER + 94;
You can do something similar for TextLength, or just get the text and measure it.
So all the ways turn into using Win32 API to rewrite code from scratch. I don't like using Win32 API, because it involves a lot of things, such as Marshal, Permission, unsafe...
It makes your code not reusable. If someday Microsoft rewrites their System.Windows.Forms.dll file and the USER32.DLL file disappears..., then you have to rewrite your code. You have to change every time Microsoft changes.
And when the 64-bit Windows is released in the future, I think that USER32.DLL will be replaced by USER64.DLL...
Leslu wrote: Mac OS has the full support of .NET. You can run not only C# in Mac OS but all the .NET compatible languages in it.
This is not true. There is a reference implementation for BSD which is the OS the OS X is based, however it doesn't support enough of the framework to allow Windows C# apps to run on an Apple.
Even the linux Mono project, only currently supports a subset of the entire .NET framework.
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
The first part of his statement may be wrong, but his second part is not. Since all languages targeting the CLR produce IL (with little differences due to compiler optimizations and language features), any pure .NET language will work (for instance, mixed-mode Managed C++ would not because it contains native instructions).
Just wanted to point that out to make sure there was no confusion on this often-misunderstood subject.
I am building a custom WebControl and I would like to render an image in that custom control. I have a solution but it is not the solution I would like. Currently I am saving my image as a file and writing an html "img source" tag pointing to that file at the time I am asked to render my control into the HtmlTextWriter.
The solution I would like is to be able to stream the image into the page so that I am not required to create an image file.
The one long string can't have single quotes in it, cause it will screw up my javascrip parameter which wraps single quotes around the string.
Would some kind of XML work for sticking all strings into one big string? And UML or URL converter class work?
Anyone have any ideas? I am hoping for some built in classes in the framework. There must be some kind of delimiter string creator class and html formatter class? I cant find any.
I have a moule that generates some excel files over an ASP.NET page. Depending on the request, some files can take a long time to download. So, I thought it would be a nice idea to use a web service that would do this in the background.
I have no experience with web services whatsoever. Is it possible to do the following with the web service:
- The client does not get stuck in the page. Basically, the request should be processed in the background. Currently, when I do this in an ASP.NET page, the page waits on the load till the request is complete. What I want is to process the request in the background and the user should be free to browse the site.
- Have a callback that will notify the user that the request has been complete.
If someone can suggest on such background processing of tasks, I would be really grateful.
Without struggle, there is no progress
Last Visit: 31-Dec-99 19:00 Last Update: 28-Nov-23 0:42