Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Printing to a label (be it class or whatever you like)


DMF
 Share

Recommended Posts

this isnt just for eclipse will work on anything tested in blank vb6 form, i do use it alot with some other stuff.

there is a example project below with controls added so you can see what you need for it and see that it works.

```

Public ClassInfoStore As Long

Option Explicit

```

```

Private Sub cmbClass_click()

ClassInfoStore = cmbClass.ListIndex

Call RefreshClassText

End Sub

```

```

Public Sub RefreshClassText()

Dim ClassN As String

Dim ClassI As String

ClassInfoStore = cmbClass.ListIndex

Select Case ClassInfoStore

Case 0

ClassN = "xxxx"

ClassI = " xxx xx xxxxx xxxx xx" & vbNewLine & "xxx xx xxxxx xxxx xx"

lblInfor.ForeColor = RGB(117, 251, 35)

Case 1

ClassN = "cccc"

ClassI = " ccc cc ccccc cccc cc" & vbNewLine & "ccc cc ccccc cccc cc"

lblInfor.ForeColor = RGB(35, 147, 251)

Case 2

ClassN = "rrrr"

ClassI = " rrr rr rrrrr rrrr rr" & vbNewLine & "rrr rr rrrrr rrrr rr"

lblInfor.ForeColor = RGB(251, 35, 71)

End Select

lblInfor.Caption = ClassN & vbNewLine & ClassI

End Sub

```

now ill explain , ClassN is name or maybe type of class or maybe the info's title. ClassI is the info your showing.

Also ive added forecolor function with the rgb. 3 values make colors ,attach lbl to forcolor make text change color.

this is really a rewrite of my own code i use to print quick stuff. 0 brains required it will work copy and paste if you mess it up…. O.o ... EH XD lol

**:Example Project:**

[LINK](http://freemmorpgmaker.com/uploadfiles/3fbd1318bf94063d832eb8fd4064a613.zip)
Link to comment
Share on other sites

TL:DR for this topic

(labelname).caption = (text here)

> I dont understand why you need a case select in this? What's its function?

The value is taken from an external source. (A combobox) For evaluating the value of the combobox the Select Case.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...