Ravi Shankar Kota
Ravi Shankar Kota

Reputation: 705

Change Label to Textbox in VB6

I have a support application in VB6. It has a form with all Label fields to show data.The requirement is change all the Labels to Textbox's in the form.

I could not see any source code to do it easily for all the controls in the form. What is the best alternative to do this other than manually changing every label to textbox?

Upvotes: 2

Views: 2082

Answers (2)

Rob
Rob

Reputation: 3381

You could change it by editing the .frm file for the form. You cannot do this in the Visual Basic IDE you will need to use a text editor. A simple label looks like this:

   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Existing Designs:"
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   2175
   End

An edit box like:

   Begin VB.TextBox CardName 
      Text            =   "Existing Designs:"
      Height          =   285
      Left            =   240
      TabIndex        =   0
      Top             =   4320
      Width           =   6375
   End

You could easily convert one type of control to another with a few search and replaces.

Upvotes: 5

Divyam Solanki
Divyam Solanki

Reputation: 1

You can not convert. Because both of these are objects have some data, methods and properties which are different with respect to each other.

Upvotes: 0

Related Questions