Pull the first ActiveX control ~~ Although simple, it is a good start ~~ Haha

Source: Internet
Author: User

This is my first ActiveX control. You are welcome to comment and discuss it ~

 

This is a very simple ActiveX control completely implemented by drawing. First, go:

 

 

Haha... But it seems a little embarrassing. How does it feel like there is nothing ?...

 

In fact, this is the case. I used a timer to move and change the arrow and the number above.

 

The arrow and number are synchronized from the left to the right. The initial attribute is set to 1 second. Arrows and numbers are moved from the left to the right within 1 second. The number changes from 380.0 to 480.0, with a total of 100 scales.

 

ProgramThe key part should be the drawing part of arrows and numbers. In order not to flash the screen too much (if you draw a picture on the main window, it will flash 100 in one second, the yellow axis in the middle will flash very ugly), so I use two subwindows to implement it.

Currently, I only write five methods as needed, 1. To pause and continue, you can pause arrows and numbers in one of the points or continue to move; 2. Speed Setting: the minimum speed is 1 second. Even if the Internal timer is set to 10 ms, why can't it be smaller? Is it the internal relationship of ActiveX Control? Anyway, I can only set it to 10 ms at the minimum. If it is smaller, it is no different from 10 ms; 2. To move a certain segment in the middle, you can set the range of the Movement (of course, within-); 4. Implement to fix arrows and numbers on a specific value and pause; 5. Obtains the current pause status to determine whether the pause status is in progress;

 

CodeKey part:

First. In my opinion, it should be the creation and drawing of the subwindow. Because it is the drawing of the subwindow, of course we need to derive a class pull from the cstatic class, just rewrite onpaint.

Second. When adding a method, I never knew how to associate the internal method with the external method at the beginning... After thinking about how to add a method with parameters for half a day, I learned that the parameters must be added directly below when the method dialog box is created... Everything else is actually quite simple ...... Haha, but since it was the first one I wrote, I still feel a sense of accomplishment ~~

 

Well, I don't want to talk about it anymore. If you are interested, let's take a look at it ~~ Thank you for your comments and comments ~~

 

:

Http://download.csdn.net/source/2652168

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.