|
Hello,
I write a C# editor using a RichEditBox (in C# langage of course !!).
I want to add syntaxic coloration. I want to use the Select(),
SelectionColor() functions.
My problem is to know the actual Caret position: where is my keyboard cursor ?
I found some function like GetCharFromPosition,
GetPositionFromCharIndex, etc., but I can't retrieve the caret position with it.
What for technique should I use to get this value ?
Thank you in advance for your help !
Bye
Sylvain.Gross@oreka.com
Sylvain.Gross@oreka.com
|
|
|
|
|
You're looking for .SelectionStart. Sadly, though, the RichTextBox is not good at colorization. The larger your document gets, the slower colorization works.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Maxutil Computer Skills : A group of software professionals based at Lucknow( INDIA) already have ventured with the .NET Technologies and Registrations are open for 2nd Batch of C# and Visual Basic .NET .In our group we have the Green Card Holders and definitely they know the international standards of the industry and we make our curriculum acording to international community standards.
Feedback : Better to ask our students of 1st Batch.
For more information : info@maxutil.com
Maxutil Computer Skills.
...An Engineering Appraoch to Computer Education.
Address :
Maxutil Computer Skills
B-43,Sector-B,Aliganj
Lucknow (INDIA).
PHONE : +91-9839014157
|
|
|
|
|
What horrible business practices! Try to get free advertising on a world-wide forum?
With the cheap-ass way to do advertising, why on earth would I want to take your classes?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how can i iterate through a table based on one of the column entries...
plz help me!
thanks
sai
|
|
|
|
|
Hi,
I am using ASPX file with embedded C# code. I have a Button Web Control that needs to call a C# method on the same page. This method will create a pop-up window with a calendar web control, let the user select a date, and return the date selected as a string. How do I write this method?
Thank you for any help.
Dannyl.
|
|
|
|
|
Is it, or will it be, possible to create any browser based applet like functionality with c#, (such as browser based chat, ftp, etc; or graphical display)?
|
|
|
|
|
You can develop incredibly rich apps using WebForms where most of the processing is performed @ the Server and most validation & UI stuff is done in JavaScript on the client.
If you know your client is running .NET (remember it's going to be available for Win98, ME, WinNT, Win2K and WinXP initially), then of course you could develop a rich client-side WindowsForms or WebForms app, which consumes services from a Server via WebServices.
Rich.T.
|
|
|
|
|
You can develop applet like functionality by developing controls with WinForms. You can deploy them like ActiveX controls on web pages, in Internet Explorer 5.5 and above. See http://www.gotdotnet.com/team/windowsforms/iesourcing.aspx for more.
|
|
|
|
|
I'm in the process of trying to call our Verity COM object from within a .NET c# class. I successfully made a reference to the COM object from within VS.NET, and it seems to have worked in that I can see the methods and properties of the object. (from my reading, my adding a reference from VS.NET, it automatically takes care of creating the metadata necessary to call the COM object from within .NET as opposed to running the command line tlbimp.exe)
I am also able to create the object, and set some properties....however when trying to set some one object type to another, the compiler will not let me do it.
For example:
The Verity Object has a Vsearch class. A method in the vsearch class is called "GetResults()". The docs say it returns a "Result" Object.
So in my code, I create a Search object, a Result object, and then try to set my result object to the contents...like this
VerityIS.Vsearch mysearch = new VerityIS.Vsearch();
VerityIS.Result myresult = new VerityIS.Result();
...set some parametes for searching on mysearch, then execute the GetResults() method.
myresult = mysearch.Getresult();
The compiler complains that you cannot implicitly convert type "Object" to "VerityIS.Result"....meaning it sees the mysearch.Getresult() as returning just an "Object" type.
So then I try to use explicit casting.....
myresult = (VerityIS.Result)mysearch.GetResult();
The compiler let's me do this, without a problem. However, when I call this from within a ASP+ page, I get the InvalidCastException error message.
My question is, Is this a bug? Or, is there someway for me to identify the mysearch.Getresult() as the type of "VerityIS.Result" to the .NET framework??
|
|
|
|
|
Does anybody know how to create a singleton object in C#? I've been looking through the documentation on MSDN, but haven't had any luck.
Thanks,
Lee
|
|
|
|
|
Nevermind. For anyone that is interested, you can go to the following site and see how it is done.
http://www.clipcode.com/components/singleton_designpattern.cs.txt
Lee Nowotny
|
|
|
|
|
|
Wort wort wort...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Any tips on how to either cause a GPF or emulate one? I am attempting to write a "hello world, prepare for defenestration!" program for a coworker, and can't figure out how to cause a GPF... I guess I could dig up a screenshot and call the image, as I'm not trying to make a malicious app, just a funny pointless one.
|
|
|
|
|
Hmmm... .NET Framework -> virtual machine. Not possible unless you call unmanaged, unsafe code.
The easiest way to do this, without pissing anyone off, is to dig up a screen shot.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In VC6,I can define my message:#define WM_MYMESSAGE (WM_USER+1),
But how to define my message and process it in C#?
thank u!
|
|
|
|
|
Why would you want to use this? In .NET, messages are a platform thing. Try creating your own custom event instead.
Rich.T.
|
|
|
|
|
Someone said in this forum that in ASP+ you can use C#.
That means that C# has a ScriptEngine Implementation?
To be more specific with my guestion,
If i have a program (in VC++) where i use ActiveScripting,
and want to add suport for C# i should:
a) Just Create the C# ScriptEngine in the same
manner i did with JS and VBS and pass it my ScriptSite.
b) Create the C# ScriptEngine and implement a
new interface in my application (like: IScriptSite3 | IScriptSiteEx).
c) Forget everything i knew about ActiveScripting and
start over a new project.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
ASP.NET (same as ASP+) doesn't use a scripting model the way ASP does; it uses a compiled code model.
You get the ability to use C#, VB (not VBS), and JScript.NET (also compiled) from within ASP.NET, and all of them are compiled to IL and then JITted at runtime.
There is, however, no scripting version of C#.
If you explained a bit more about what you were trying to do with your scripting stuff, I might be able to point you in the right direction.
|
|
|
|
|
Thanx for the information.
I allready found some information about
calling C# from C++.
I guess this is the new way to do scripting.
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
OK, I took a look thru the C# docs, trying to find how to write a COM server DLL, but I found nothing. (My plan was to write a shell extension using C#.) Can anyone point me in the right direction here?
--Mike--
http://home.inreach.com/mdunn/
I'm finger-lickin' good!
|
|
|
|
|
The runtime does most of the dirty work for you. The steps are:
1) Write your component in C#, as if you were writing it in COM but with .NET data types. How difficult this is depends upon how complex the interface is and what kind of types are used. You might want to look at the data marshalling docs before you start, and I think there's also a COM interop document as part of the SDK docs.
2) Build your component, register it with regasm, and then put it in the Global Assembly Cache with gacutil. VS will do part of this for you if you add a deployment project, but it doesn't do the GAC part for you in Beta 1.
3) At this point, COM should be able to find your component, and the runtime takes it from there.
If you come up with a cool shell extension, I'd love to see it.
|
|
|
|
|
*headscratch* hmm... methinks I need to pick up a C# book to make sense of all this new stuff. Know of any good books?
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
The best C# book is Inside C# 2nd ed by Tom Archer.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|