home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / upplow / upplowhl.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1995-03-01  |  2.6 KB  |  72 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    BackColor       =   &H00808080&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Function - ForceUpperOrLowerCase"
  6.    ClientHeight    =   4020
  7.    ClientLeft      =   3195
  8.    ClientTop       =   2610
  9.    ClientWidth     =   6015
  10.    ControlBox      =   0   'False
  11.    Height          =   4455
  12.    Left            =   3120
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    MousePointer    =   3  'I-Beam
  17.    ScaleHeight     =   4020
  18.    ScaleWidth      =   6015
  19.    Top             =   2250
  20.    Width           =   6165
  21.    Begin TextBox Text1 
  22.       Alignment       =   2  'Center
  23.       BackColor       =   &H00808080&
  24.       BorderStyle     =   0  'None
  25.       ForeColor       =   &H0000FFFF&
  26.       Height          =   3615
  27.       Left            =   120
  28.       MultiLine       =   -1  'True
  29.       TabIndex        =   0
  30.       Text            =   "Text1"
  31.       Top             =   120
  32.       Width           =   5415
  33.    End
  34. ' SetUpLoH.Bas - Help Screen
  35. ' 95/03/02 Copyright 1995, Larry Rebich, The Bridge, Inc.
  36.     Option Explicit
  37.     DefInt A-Z
  38.     Declare Sub SendMessage Lib "User" (ByVal hWnd%, ByVal wMsg%, ByVal wParam%, lParam As Any)
  39. Sub BuildHelpMessage ()
  40.     Dim Msg As String
  41.     Dim Cr As String * 2
  42.     Cr = Chr$(13) & Chr$(10)
  43.     Msg = Cr
  44.     Msg = Msg & "Any text entered in the upper case text box is converted to all upper case.  "
  45.     Msg = Msg & "Any text entered in the lower case text box is converted to all lower case." & Cr
  46.     Msg = Msg & Cr
  47.     Msg = Msg & "Function ForceUpperOrLowerCase is used to force "
  48.     Msg = Msg & "upper or lower "
  49.     Msg = Msg & "case input.  For example: " & Cr & Cr
  50.     Msg = Msg & "x = ForceUpperOrLowerCase(Text1(1), True)"
  51.     Msg = Msg & Cr & Cr
  52.     Msg = Msg & "See module UppLow.Bas for details." & Cr & Cr
  53.     Msg = Msg & "Note: This text box has been set to 'read only' using API SendMessage.  See subroutine 'SetReadOnly' in this form for details." & Cr
  54.     Text1 = Msg
  55. End Sub
  56. Sub Form_Load ()
  57.     Dim l, t, w, h
  58.     w = Text1.Width + 500       'make form fit the text box
  59.     h = Text1.Height + 500
  60.     l = (Screen.Width - w) \ 2
  61.     t = Form1.Top + Form1.Height + 100  'just below the main form
  62.     Move l, t, w, h
  63.     Text1.Move 150, 150         'set its location
  64.     SetReadOnly Text1           'set text box to read only
  65.     BuildHelpMessage            'build the message
  66. End Sub
  67. Sub SetReadOnly (TheControl As Control)
  68.     Const WM_USER = &H400
  69.     Const EM_SETREADONLY = (WM_USER + 31)
  70.     SendMessage TheControl.hWnd, EM_SETREADONLY, 1, 0
  71. End Sub
  72.