Solved

Creating ActiveX user interface.

Posted on 1998-10-02
3
181 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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
Comment Utility
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
Comment Utility
>> 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
Comment Utility
Thanx for good explanatry answer. It will help me a lot.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now