473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

IntelliSense in .net application

i am creating a formula editor and would like to provide intellisense feature
to the textbox in formula editor. does any one know how can i do that?

thanks
Feb 2 '07 #1
1 2626
Hi,
>i am creating a formula editor and would like to provide intellisense
feature
to the textbox in formula editor. does any one know how can i do that?
You're not going to be able to use IntelliSense, AFAIK, but you could make
your own, similar tool.

When the user presses some key combination in your editor, show a ComboBox
in DropDownList mode near the text cursor after filling it with the
appropriate items.

Monitoring key presses is a simple matter of handling the appropriate event
for the editor control, which is probably KeyUp. Showing and hiding the
ComboBox is easy with the Show and Hide methods, respectively. Discovering
the position of the text cursor depends a lot on how you've implemented, or
are planning on implementing, your editor.

For your editor, you might find that using the WebBrowser in design mode [1]
or with isolated editable content [2] will be much more functional [3] than
using a simple TextBox. You can locate the position of the text cursor
using the TextRange Object [4]. Using the editor you can provide very rich
behavior using a combination of managed code, JScript and the DHTML DOM.
With the WebBrowser control you can create your own edit designers and
custom glyphs. You could even add visual markup such as squiggly red lines
if you're up to the challenge. To use many of the DOM functions from within
managed code, you'll need a reference to the MSHTML assembly. There is a
primary interop assembly (PIA) that you can reference as of the .NET
Framework 2.0 [5].

If you decide to just use a TextBox then I believe you must calculate the
text cursor's position based on the Font size and the SelectionStart
property using the Graphics.MeasureString method. Get a Graphics object
from the CreateGraphics method and dispose of it immediately after the code
has finished using it, but don't attempt to paint with it. You may also
have to account for scroll bars. I haven't tried this approach myself so
there might be an easier way, but it's doubtful.

--
Dave Sexton
http://davesexton.com/blog
http://www.codeplex.com/DocProject (Sandcastle in VS IDE)

[1] designMode Property
http://msdn2.microsoft.com/en-us/library/ms533720.aspx

[2] CONTENTEDITABLE Attribute | contentEditable Property
http://msdn2.microsoft.com/en-us/library/ms533690.aspx

[3] How to Create an HTML Editor Application
http://msdn2.microsoft.com/en-us/library/aa969729.aspx

[4] TextRange Object
http://msdn2.microsoft.com/en-us/library/ms535872.aspx

[5] Accessing Unexposed Members on the Managed HTML Document Object Model
§ Accessing Unmanaged Interfaces
http://msdn2.microsoft.com/en-us/library/ms171716.aspx
Feb 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stefan Kronberg | last post by:
I'm working on a solution containing about 20 projects. Some of the projects contain class definitions that are used in other of the projects. Most of the time intellisense is working ok, i.e. if I...
0
by: Jim | last post by:
I had a strange problem the other day when using Intellisense, and wondering if anyone has any experience with or advice on this... Just to give some quick background, I have a multi-tier...
9
by: Ulf Lindback | last post by:
Hi! We have an application surveillance product with a number of API's for different languages; one of them is a C API. Now I wonder how we can supply intellisense to our Visual Studio.Net...
26
by: S. Justin Gengo | last post by:
I installed the release of Visual Studio.NET 2005 Professional a few days ago. I've been using the Beta for a few weeks and one immediate problem is that I don't seem to have full intellisense in...
12
by: Peteroid | last post by:
I was creating my application just fine for the last 3 weeks or so. Then, starting this morning, IntelliSense seems to be having problems. It goes into a locked 'Updating IntelliSense..." mode....
1
by: tool | last post by:
Hi all, I Followed these steps : 1. Added a .master file with 3 contentplaceholder controls. 2. Added an aspx file with the @Page directive parameter 'MasterPageFile' set to my .master file....
2
by: avanti | last post by:
Hi, I am developing an application where the scripts are written in the XML files. The application parses them and creates required CS files and runs them. The application has set of APIs that are...
1
by: RLN | last post by:
Re: Access 2003 I found a method here in the newsgroup that works for clearing checkboxes, but don't understand a particular line of code and how it works. Here is the code: 1. Dim ctrl As...
3
by: Joseph Geretz | last post by:
Our application is primarily VB6, however we are migrating toward .NET and a newer architecture. For the time being though, we're stuck with a hybrid approach with our ActiveX client application...
3
by: =?Utf-8?B?SmltIFJvZGdlcnM=?= | last post by:
It's perhaps not the end of the World, but I find it annoying that I lose IntelliSense when I reference Subs and Functions I have moved to an #Included file. Does anyone know of a reasonable way...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.