Solved

Creating ActiveX user interface.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
GIF file bit manipulation for color change 5 107
maven archtype selection in eclipse 1 53
zeroFront challenge 7 80
Sed question 2 68
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

910 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

23 Experts available now in Live!

Get 1:1 Help Now