Solved

Creating ActiveX user interface.

Posted on 1998-10-02
3
184 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
fizzArray  challenge 1 82
isEverywhere  challenge 19 75
Work with App store 7 51
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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

776 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