Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating ActiveX user interface.

Posted on 1998-10-02
3
Medium Priority
?
190 Views
Last Modified: 2013-11-20
Hi, I want to develope an activeX grid control. My background in activeX creation is that I have just developed a graph control. I want to ask that how can I create the interface of grid(drawing of lines and columns. How should I start it.
0
Comment
Question by:Moin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 150 total points
ID: 1322857
Depending on how sophisticated you want it you can do it 3 obvious ways :-

(i) Make your control based on the ListView control.  In details mode this is kind of a grid with column headings.  By using ownerdraw you can paint anything you like anywhere in the list.  The downside to this approach is loss of flexibility.  You will only be able to "bend" the standard list view so much.

(ii) Paint everything yourself

Basically use the standard windows scroll bars, but as far as the grid is concerned do all painting of grid elements yourself, you know how to do lines boxes etc. from your graph experience.  Basically the same approach for a grid.  The hard part is when you want to do in-place editing.  You can either process key strokes or create an edit control as a child window at the right X,Y position.

When you paint the grid this way, a good trick is paint via an off screen bitmap and bitblt it to the control.  This will give the appearance of less flickering.


(iii) Create many controls, edits, combos and perhaps even your own custom controls for grid cells (e.g. WS_CHILD is part of their style).  Then use MoveWindow to scroll them around in response to scroll bars etc.  The problem with this approach is speed.  Moving many controls may be too slow.  Ideally you only want to create those controls which are active and use (ii) for painting parts of the grid which don't change


You can get a pretty good start by looking at the Grid control article at
http://www.codeguru.com/controls/index.shtml

This derives a list from CWnd - which is pretty similar to approach (i)
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322858
>> This derives a list from CWnd - which is pretty similar to approach (i)

Oops this should have said the grid control uses the ListView control (but not the MFC class as far as I can see).

It also uses the bitmap idea (CMemDC) to reduce flickering
0
 

Author Comment

by:Moin
ID: 1322859
Thanx for good explanatry answer. It will help me a lot.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question