Solved

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

Posted on 2013-07-01
10
312 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

734 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