Give a simple example of the trackbar control in "blog V5 ".

Source: Internet
Author: User
Problem Source: http://www.cnblogs.com/del/archive/2008/06/14/1220638.html#1225896
Example 1:


Example 1 Code :
 
Unit unit1; interfaceuses windows, messages, extensions, variants, classes, graphics, controls, forms, dialogs, comctrls; Type tform1 = Class (tform) trackbar1: ttrackbar; Procedure trackbar1change (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.trackbar1change (Sender: tobject); Begin self. text: = inttostr (trackbar1.position); end.

  

Example 2:


Example 2 code:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, comctrls, stdctrls; Type tform1 = Class (tform) trackbar1: ttrackbar; button1: tbutton; button2: tbutton; button3: tbutton; Procedure upload (Sender: tobject); Procedure button1click (Sender: tobject); Procedure upload: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure merge (Sender: tobject); begin button1.caption: = 'change'; button2.caption: = 'change'; button3.caption: = 'restore'; end; Procedure tform1.button1click (Sender: tobject); begin trackbar1.showselrange: = false; end; Procedure transaction (Sender: tobject); begin transaction: = trvertical; end; Procedure transaction (Sender: tobject); begin trackbar1.showselrange: = true; trackbar1.orientation: = trhorizontal; end.

  

Example 3:


Example 3 code:
 
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, comctrls, extctrls; Type tform1 = Class (tform) trackbar1: ttrackbar; Panel1: tpanel; Procedure formcreate (Sender: tobject); Procedure trackbar1change (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure alert (Sender: tobject); begin alert: = false; trackbar1.min: = 1; trackbar1.max: = clientwidth; trackbar1.position: = clientwidth Div 2; trackbar1.height: = 23; panel1.left: = 0; end; Procedure tform1.trackbar1change (Sender: tobject); begin panel1.width: = trackbar1.position; end.

  

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.