473,883 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?

Feb 2 '07 #1
1 2660
>i am creating a formula editor and would like to provide intellisense
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.Measur eString 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://www.codeplex.com/DocProject (Sandcastle in VS IDE)

[1] designMode Property

[2] CONTENTEDITABLE Attribute | contentEditable Property

[3] How to Create an HTML Editor Application

[4] TextRange Object

[5] Accessing Unexposed Members on the Managed HTML Document Object Model
§ Accessing Unmanaged Interfaces
Feb 3 '07 #2

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

Similar topics

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 work with objects declared from my own classes intellisense will show me all alternatives (methods and properties from my classes and from the classes they are derived from). But sometimes I will get nothing from intellisense, completely nothing,...
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 application, with business objects coded in a business layer (C# project), the service interfaces and service objects coded in two C# projects, respectively. In my service objects project, I go to call on one of the
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 (native C/C++) users (preferably both VS 7.0 and 7.1). I would like to have something like the parameter info you get for e.g. printf when you enter the opening parenthesis, printf(
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 the web.config file. I get intellisense, but it's only displaying three very basic choices: <!-- <!www.aboutfortunate.com "Out of chaos comes order." Nietzsche
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. When this happens its time to close VS C++.NET, which can only be done via the Windows Task Manager. I tried repairing C++. It did seem to help, but the problem is back a few hours later. I will try creating a new project, copy over source files,...
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. 3. Added an asp:Content in the page. intellisense in my .aspx file worked and the application ran and
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 used in the XML scripts. While writing the XML scripts, there is no intellisense available. I want to have intellisense in the XML editor for a particular dll. Is that possible? Does VS support it? Or are there any other editors that have...
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 Control 2. For Each ctrl In Me.Controls 3. 'uncheck all of the checkboxes...
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 accessing .NET Web Services provided by the new server-side application. We like the benefits of Intellisense in the IDE. Visual Studio .NET will provide Intellisense for a .NET client which references and accesses a Web Service. Unfortunately...
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 to restore the IntelliSense feature in this case? Thanks for your thoughts... Jim Rodgers
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.