Guidance
指路人
g.yi.org
software / rapidq / Examples / String & Text / textwidth.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
' From: BlackAdder(9/7/02 1:19:52 pm)
' centers a text string horizontally using textwidth:

     $INCLUDE "rapidq.inc"
     $TYPECHECK ON
     DECLARE SUB click
     CREATE Form AS QFORM
      BorderStyle = bsSingle
      DelBorderIcons(biMaximize)
      CAPTION = "My Program"
      Width = 400
      Height = 300
      Center
      CREATE button1 AS QBUTTON
       top = 10
       left = 10
       onclick = click
      END CREATE
     END CREATE

     Form.SHOWMODAL

     SUB click
      DEFSTR text = "hello world"
      DEFINT x
      x = (form.clientwidth/2) - (form.textwidth(text)/2)
      form.textout(x, 150, text, clRed, -1)
     END SUB
掌柜推荐
 
 
¥477.00 ·
 
 
¥918.00 ·
 
 
¥370.00 ·
 
 
¥271.00 ·
 
 
¥995.00 ·
 
 
¥1,580.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-09-08 09:01:26