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

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

Erm do you need to make a label or something?

hold on sherwin im posting a example project forthem 😜

Updated : example project, will contain controls and show this workin

Updated: colored text. example updated. o.o

I dont understand why you need a case select in this? Whats its function?

it really does need a label , nice tut for classes (although , the game i was working on doesn’t have classes)

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.

Oh right yeah xD

abhi actualy explained something, anyways ya if u read code u will notice it has a label.attached project shows u it has a label xD so idk wat to tell you all,

Log in to reply