Solved

bold an SQL statement

Posted on 2015-01-19
10
113 Views
Last Modified: 2015-01-26
here's part of my sql

,Stock.VIN + ' ' + Customers.LastName + ' ' + Customers.FirstName + ' ' + Customers.MiddleInitial AS DisplayField

? - If there any way to bold the stock.VIN  portion of the DISPLAYFIELD field in the dropdown combobox
0
Comment
Question by:MBHEY131
[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
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 40557909
Font issues are determined by whatever system does the display.  How are you displaying your results?

If it's in HTML, for example, embedding some tags would be pretty simple.
0
 

Author Comment

by:MBHEY131
ID: 40557935
How are you displaying your results?

In a regular old dropdown combobox on a regular old windows form

I'm very new to vs2012.
0
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 40557962
Hmmm ... best guess would be an RTF tag.
http://en.wikipedia.org/wiki/Rich_Text_Format

,'{/b ' + Stock.VIN + '} ' + Customers.LastName + ' ' + Customers.FirstName + ' ' + Customers.MiddleInitial AS DisplayField

Open in new window

0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:MBHEY131
ID: 40559213
I get an error that it's not a RTF doc.
0
 

Author Comment

by:MBHEY131
ID: 40559558
here's part of my sql

 ,Stock.VIN + ' -  ' + Customers.LastName + ' ' + Customers.FirstName + ' ' + Customers.MiddleInitial AS DisplayField

 ? - If there any way to bold the stock.VIN  portion of the DISPLAYFIELD field in the dropdown combobox

Can anyone tell me how to embolden, bold, enlighten etc. the 1 field of the dropdown only to make it a easier to see
in code or at development?

I have added the ' - ' and it helps but I would like a little more of a distinguishing characteristic.
I know I can embolden the whole DROPDOWN in the properties but that does not do much good.
0
 
LVL 82

Expert Comment

by:David Johnson, CD, MVP
ID: 40569181
none of your partial sql is an sql query.  You do the query and have the results returned as an array
how you display the output is up to you
output = + Stock.VIN + ' -  ' + Customers.LastName + ' ' + Customers.FirstName + ' ' + Customers.MiddleInitial
doc.write(output)
0
 
LVL 40
ID: 40569369
In a Windows Form ComboBox, there is no way to set the format of a portion of the text. The Font property can apply only to the whole list.

The only possible way to do that would be to use a custom ComboBox in which you draw the text yourself, not something for somebody who is new to .NET. You might be able to find a custom control that already has that feature, either commercially or through a search on the web.

This is the same for any Windows Form control, except the RichTextBox, that has been created specifically for that purpose.

The same would hold for VB6 if this is what you mean by "regular old dropdown".
0
 
LVL 20

Accepted Solution

by:
ElrondCT earned 500 total points
ID: 40569995
Microsoft provides code for a multicolumn combobox which draws each column separately, with a separate font parameter per column, using the .DrawItem event handler. It should be relatively simple to change the font (to bold, or even to a different font style) on one of the columns: http://support.microsoft.com/kb/982498/en-us

However, to use their code you'll probably have to load your data into another table, which you can pass to the combobox as its data source. Or you need another way to both send the data and indicate where the font should change (perhaps a flag character that would never be in actual data).
0
 

Author Comment

by:MBHEY131
ID: 40570778
I really don't understand this and will keep my combobox like it it UNLESS my users really complain some more than they are now, I appreciate the input but it seems like the change will be more work than worth.

I thought it was a minor line of code to adjust the font on just 1 column.
0
 
LVL 40
ID: 40570860
You can. But since there is only 1 column on the standard ComboBox... :-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

626 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