Use tstringgrid [7]-colwidths [0], rowheights [0], and gridlinewidth

Source: Internet
Author: User
In this example:


Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, extctrls, grids; Type tform1 = Class (tform) stringgrid1: tstringgrid; outputs: tpanel; outputs: tbutton; button2: tbutton; button3: tbutton; button4: tbutton; button6: tbutton; Procedure outputs (Sender: tobject ); procedure alert (Sender: tobject); Procedure button4click (Sender: tobject); Procedure button5click (Sender: tobject); Procedure alert (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} {left Unit +} procedure tform1.button1click (Sender: tobject); begin tbutton (sender ). caption: = 'left cell + '; stringgrid1.colwidths [0]: = stringgrid1.colwidths [0] + 10; end; {left cell-} procedure tform1.button2click (Sender: tobject ); begin tbutton (sender ). caption: = 'left cell-'; stringgrid1.colwidths [0]: = stringgrid1.colwidths [0]-10; end; {upper cell +} procedure tform1.button3click (Sender: tobject ); begin tbutton (sender ). caption: = 'Upper unit + '; stringgrid1.rowheights [0]: = stringgrid1.rowheights [0] + 10; end; {Upper unit-} procedure tform1.button4click (Sender: tobject ); begin tbutton (sender ). caption: = 'Upper unit-'; stringgrid1.rowheights [0]: = stringgrid1.rowheights [0]-10; end; {grid line +} procedure tform1.button5click (Sender: tobject ); begin tbutton (sender ). caption: = 'grid line + '; stringgrid1.gridlinewidth: = stringgrid1.gridlinewidth + 1; end; {grid line-} procedure tform1.button6click (Sender: tobject); begin tbutton (sender ). caption: = 'line-'; stringgrid1.gridlinewidth: = stringgrid1.gridlinewidth-1; 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.