VB6 - Put some text in List one in BOLD and copy to clipbord

Hi All

I have this code that feeds my List box and then copy to clipboard.

The thing is that i would like to put in bold everything that is between "".

Ex:
Between "", we have in the code below:  
"Vendor Division: "
"Vendor name: " 

So in the List1, i would see them as:
Vendor Division:
Vendor name:  


And after, when i copy to clipboard, i would still copy the format. What's in BOLD, it would copy in BOLD and what is not in BOLD would not be copied in BOLD.

How can i do that?

Thanks again for your help


Private Sub Command2_Click()
    List1.Clear
    List1.AddItem file_supply_chain
    List1.AddItem "Vendor Division: " & vendor_div.Text
    List1.AddItem "Vendor name: " & vendor_name.Text

    Dim buf As String

    Dim i As Long

    For i = 0 To List1.ListCount - 1

        buf = buf + List1.List(i)

        buf = buf + vbCrLf

    Next

    Clipboard.Clear
    Clipboard.SetText buf

End Sub

Open in new window

LVL 11
Wilder1626Asked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
This looks like a possible solution:
http://www.vbaccelerator.com/home/VB/Code/Controls/Combo_and_List_Boxes/Owner_Draw_Combo_and_List_Box/VB6_Owner_Draw_Combo_List_Control.asp
There is an .OCX, a ,Dll and a demonstration project. They are all downloadable.
0
 
GrahamSkanRetiredCommented:
There can only be one font setting for all text in a Listbox, so that wouldn't be possible.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Wilder1626Author Commented:
Thanks,

Question knowing that it wouldn't be possible, is there an alternate solution so that what i need would be feasible?

k-designers, your solution is for C+, not VB6
0
 
Wilder1626Author Commented:
Hi GrahamSkan

I'm having the run time error 429
ActiveX component can't create object.

I have put the ocx into the system32 but still not working.
0
 
GrahamSkanRetiredCommented:
Have you registered the dll and the ocx?
0
 
Wilder1626Author Commented:
Both dll and ocx are in the System32 folder but still the same run time error
0
 
Wilder1626Author Commented:
from what i see , there is not dll. so i have removed the second file i have put in the system32 and i only left the ocx. file

But where is the dll file in question?
0
 
Wilder1626Author Commented:
HI
Now working. Thanks

I will use that as an way to do it.

Thanks
0
 
GrahamSkanRetiredCommented:
Thanks and well done in overcoming your initial difficulty in getting it to run.
0
All Courses

From novice to tech pro — start learning today.