Solved

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

Posted on 2013-07-01
10
313 Views
Last Modified: 2013-07-01
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

0
Comment
Question by:Wilder1626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39290403
There can only be one font setting for all text in a Listbox, so that wouldn't be possible.
0
 
LVL 13

Assisted Solution

by:Jesus Rodriguez
Jesus Rodriguez earned 20 total points
ID: 39290407
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39290583
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 76

Accepted Solution

by:
GrahamSkan earned 480 total points
ID: 39290782
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
 
LVL 11

Author Comment

by:Wilder1626
ID: 39290843
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39290859
Have you registered the dll and the ocx?
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39290870
Both dll and ocx are in the System32 folder but still the same run time error
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 39291123
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
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39291216
HI
Now working. Thanks

I will use that as an way to do it.

Thanks
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39291248
Thanks and well done in overcoming your initial difficulty in getting it to run.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question