Solved

Creating ActiveX user interface.

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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