CListCtrl selected higlight blue color

Hi,

I have a clistctrl. I am selecting the first entry in the list control
using the following:

SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
LVIS_FOCUSED);
EnsureVisible(0, FALSE);

The item gets highlighted but in grey color. But when I select first
item in the list contrl using mouse, the item get highlighted using
blue color.

So wanted to know what setting I have to do go the blue color on item
being selected using the above code.

I have read the article at http://www.codeproject.com/KB/list/selectentirerow.aspx.
Using OnDrawItem, I am getting the blue color but I need to write code
to handle the display of text also. Using OnDrawItem I am getting the
text to be overlapped.

So basically I want all the functionality which CListCtrl provides
except drawing the background of the items being selected. I want the
item to be selected in blue color and I donot think it is good idea to
write so much code for that.

Thanks
0
sagkumar (32)
8/26/2008 8:59:09 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
1267 Views

Similar Articles

[PageSpeed] 0

I think that you may find this control on CodeProject interesting:

"XListCtrl - A custom-draw list control with subitem formatting"
http://www.codeproject.com/KB/list/xlistctrl.aspx

I think that using it you can modify the background color of selection, 
without writing too much code for OnDrawItem, etc.

HTH,
Giovanni


"Kuenga" <sagkumar@gmail.com> ha scritto nel messaggio 
news:61460d15-76f6-44ea-8726-a5304a89878b@p31g2000prf.googlegroups.com...
> Hi,
>
> I have a clistctrl. I am selecting the first entry in the list control
> using the following:
>
> SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
> LVIS_FOCUSED);
> EnsureVisible(0, FALSE);
>
> The item gets highlighted but in grey color. But when I select first
> item in the list contrl using mouse, the item get highlighted using
> blue color.
>
> So wanted to know what setting I have to do go the blue color on item
> being selected using the above code.
>
> I have read the article at 
> http://www.codeproject.com/KB/list/selectentirerow.aspx.
> Using OnDrawItem, I am getting the blue color but I need to write code
> to handle the display of text also. Using OnDrawItem I am getting the
> text to be overlapped.
>
> So basically I want all the functionality which CListCtrl provides
> except drawing the background of the items being selected. I want the
> item to be selected in blue color and I donot think it is good idea to
> write so much code for that.
>
> Thanks 


0
Giovanni
8/26/2008 10:21:27 AM
>I have a clistctrl. I am selecting the first entry in the list control
>using the following:
>
>SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
>LVIS_FOCUSED);
>EnsureVisible(0, FALSE);
>
>The item gets highlighted but in grey color. But when I select first
>item in the list contrl using mouse, the item get highlighted using
>blue color.

Just in case you're not aware, what you're seeing is the intended
behaviour.

When the control has input focus (which it gets when you click it),
the selection is (by default) blue.

When the control does not have focus the selection is grey.

This is a useful visual distinction for users and should be what they
expect to happen. I wouldn't not recommend that you change this unless
you have a really sound design reason to do so.

>So wanted to know what setting I have to do go the blue color on item
>being selected using the above code.

You just need to set focus on the control.

Dave
0
davidl7375 (2060)
8/26/2008 1:07:59 PM
The highlight is in gray if the control does not have the focus.  The highlight is in blue
if the control has the focus.  This is very important to the user to know the control has
the focus.

Note that if you leave the control highlighted in blue, the user will assume that the
control HAS the focus, because that is how the control behaves; the number of times I've
hit down-arrow to change a selection in a badly-designed control is far too high; in fact,
I often build my own owner-draw CListBox just so I can get the gray highlighting.  If you
want the highlighting in blue, you must also SetFocus, which is usually a Bad Idea because
focus is a concept owned by the user, and you should not mess with it casually, or just
because you want to violate fundamental GUI behavior in a counter-intuitive fashion.
						joe

On Tue, 26 Aug 2008 01:59:09 -0700 (PDT), Kuenga <sagkumar@gmail.com> wrote:

>Hi,
>
>I have a clistctrl. I am selecting the first entry in the list control
>using the following:
>
>SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
>LVIS_FOCUSED);
>EnsureVisible(0, FALSE);
>
>The item gets highlighted but in grey color. But when I select first
>item in the list contrl using mouse, the item get highlighted using
>blue color.
>
>So wanted to know what setting I have to do go the blue color on item
>being selected using the above code.
>
>I have read the article at http://www.codeproject.com/KB/list/selectentirerow.aspx.
>Using OnDrawItem, I am getting the blue color but I need to write code
>to handle the display of text also. Using OnDrawItem I am getting the
>text to be overlapped.
>
>So basically I want all the functionality which CListCtrl provides
>except drawing the background of the items being selected. I want the
>item to be selected in blue color and I donot think it is good idea to
>write so much code for that.
>
>Thanks
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/26/2008 2:08:50 PM
This is a really good point. The user may go crazy trying to click the down 
arrow key when the control really does not have focus any longer.  I think 
setting the control to use LVS_SHOWSELALWAYS makes the most sense because 
the user can still  have the visual that the item is selected.

Tom

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:ic38b41r8vk4ube37l68pv5je5bh30ob1t@4ax.com...
> The highlight is in gray if the control does not have the focus.  The 
> highlight is in blue
> if the control has the focus.  This is very important to the user to know 
> the control has
> the focus.
>
> Note that if you leave the control highlighted in blue, the user will 
> assume that the
> control HAS the focus, because that is how the control behaves; the number 
> of times I've
> hit down-arrow to change a selection in a badly-designed control is far 
> too high; in fact,
> I often build my own owner-draw CListBox just so I can get the gray 
> highlighting.  If you
> want the highlighting in blue, you must also SetFocus, which is usually a 
> Bad Idea because
> focus is a concept owned by the user, and you should not mess with it 
> casually, or just
> because you want to violate fundamental GUI behavior in a 
> counter-intuitive fashion.
> joe
>
> On Tue, 26 Aug 2008 01:59:09 -0700 (PDT), Kuenga <sagkumar@gmail.com> 
> wrote:
>
>>Hi,
>>
>>I have a clistctrl. I am selecting the first entry in the list control
>>using the following:
>>
>>SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
>>LVIS_FOCUSED);
>>EnsureVisible(0, FALSE);
>>
>>The item gets highlighted but in grey color. But when I select first
>>item in the list contrl using mouse, the item get highlighted using
>>blue color.
>>
>>So wanted to know what setting I have to do go the blue color on item
>>being selected using the above code.
>>
>>I have read the article at 
>>http://www.codeproject.com/KB/list/selectentirerow.aspx.
>>Using OnDrawItem, I am getting the blue color but I need to write code
>>to handle the display of text also. Using OnDrawItem I am getting the
>>text to be overlapped.
>>
>>So basically I want all the functionality which CListCtrl provides
>>except drawing the background of the items being selected. I want the
>>item to be selected in blue color and I donot think it is good idea to
>>write so much code for that.
>>
>>Thanks
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 

0
tom.nospam (3240)
8/26/2008 5:33:38 PM
On Aug 26, 10:33=A0pm, "Tom Serface" <tom.nos...@camaswood.com> wrote:
> This is a really good point. The user may go crazy trying to click the do=
wn
> arrow key when the control really does not have focus any longer. =A0I th=
ink
> setting the control to use LVS_SHOWSELALWAYS makes the most sense because
> the user can still =A0have the visual that the item is selected.
>
> Tom
>
> "Joseph M. Newcomer" <newco...@flounder.com> wrote in messagenews:ic38b41=
r8vk4ube37l68pv5je5bh30ob1t@4ax.com...
>
>
>
> > The highlight is in gray if the control does not have the focus. =A0The
> > highlight is in blue
> > if the control has the focus. =A0This is very important to the user to =
know
> > the control has
> > the focus.
>
> > Note that if you leave the control highlighted in blue, the user will
> > assume that the
> > control HAS the focus, because that is how the control behaves; the num=
ber
> > of times I've
> > hit down-arrow to change a selection in a badly-designed control is far
> > too high; in fact,
> > I often build my own owner-draw CListBox just so I can get the gray
> > highlighting. =A0If you
> > want the highlighting in blue, you must also SetFocus, which is usually=
 a
> > Bad Idea because
> > focus is a concept owned by the user, and you should not mess with it
> > casually, or just
> > because you want to violate fundamental GUI behavior in a
> > counter-intuitive fashion.
> > joe
>
> > On Tue, 26 Aug 2008 01:59:09 -0700 (PDT), Kuenga <sagku...@gmail.com>
> > wrote:
>
> >>Hi,
>
> >>I have a clistctrl. I am selecting the first entry in the list control
> >>using the following:
>
> >>SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
> >>LVIS_FOCUSED);
> >>EnsureVisible(0, FALSE);
>
> >>The item gets highlighted but in grey color. But when I select first
> >>item in the list contrl using mouse, the item get highlighted using
> >>blue color.
>
> >>So wanted to know what setting I have to do go the blue color on item
> >>being selected using the above code.
>
> >>I have read the article at
> >>http://www.codeproject.com/KB/list/selectentirerow.aspx.
> >>Using OnDrawItem, I am getting the blue color but I need to write code
> >>to handle the display of text also. Using OnDrawItem I am getting the
> >>text to be overlapped.
>
> >>So basically I want all the functionality which CListCtrl provides
> >>except drawing the background of the items being selected. I want the
> >>item to be selected in blue color and I donot think it is good idea to
> >>write so much code for that.
>
> >>Thanks
> > Joseph M. Newcomer [MVP]
> > email: newco...@flounder.com
> > Web:http://www.flounder.com
> > MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text -
>
> - Show quoted text -

Hi,

Thanks for the responses. The problem got solved by calling the
setfocus function. The desired behaviour I was not getting before was
because of calling the SetFocus function after EnsureVisible(0,
FALSE); I called the SetFocus from the Parent of the CListCtrl, i.e
main application using the CListCtrl handle and I got the blue color.

I need that blue color, since on Vista with Vista theme, the gray
color is not prominient and user do not get the felling that an item
is being highlighted, so required this behaviour.

Thanks a lot for the help.
0
sagkumar (32)
8/27/2008 5:21:20 AM
You should not be setting focus.  Focus should be controlled by the user.  If you have
made a poor choice of theme, you should not compensate for this by changing behavior to
violate expected behavior.
					joe
On Tue, 26 Aug 2008 22:21:20 -0700 (PDT), Kuenga <sagkumar@gmail.com> wrote:

>On Aug 26, 10:33�pm, "Tom Serface" <tom.nos...@camaswood.com> wrote:
>> This is a really good point. The user may go crazy trying to click the down
>> arrow key when the control really does not have focus any longer. �I think
>> setting the control to use LVS_SHOWSELALWAYS makes the most sense because
>> the user can still �have the visual that the item is selected.
>>
>> Tom
>>
>> "Joseph M. Newcomer" <newco...@flounder.com> wrote in messagenews:ic38b41r8vk4ube37l68pv5je5bh30ob1t@4ax.com...
>>
>>
>>
>> > The highlight is in gray if the control does not have the focus. �The
>> > highlight is in blue
>> > if the control has the focus. �This is very important to the user to know
>> > the control has
>> > the focus.
>>
>> > Note that if you leave the control highlighted in blue, the user will
>> > assume that the
>> > control HAS the focus, because that is how the control behaves; the number
>> > of times I've
>> > hit down-arrow to change a selection in a badly-designed control is far
>> > too high; in fact,
>> > I often build my own owner-draw CListBox just so I can get the gray
>> > highlighting. �If you
>> > want the highlighting in blue, you must also SetFocus, which is usually a
>> > Bad Idea because
>> > focus is a concept owned by the user, and you should not mess with it
>> > casually, or just
>> > because you want to violate fundamental GUI behavior in a
>> > counter-intuitive fashion.
>> > joe
>>
>> > On Tue, 26 Aug 2008 01:59:09 -0700 (PDT), Kuenga <sagku...@gmail.com>
>> > wrote:
>>
>> >>Hi,
>>
>> >>I have a clistctrl. I am selecting the first entry in the list control
>> >>using the following:
>>
>> >>SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED |
>> >>LVIS_FOCUSED);
>> >>EnsureVisible(0, FALSE);
>>
>> >>The item gets highlighted but in grey color. But when I select first
>> >>item in the list contrl using mouse, the item get highlighted using
>> >>blue color.
>>
>> >>So wanted to know what setting I have to do go the blue color on item
>> >>being selected using the above code.
>>
>> >>I have read the article at
>> >>http://www.codeproject.com/KB/list/selectentirerow.aspx.
>> >>Using OnDrawItem, I am getting the blue color but I need to write code
>> >>to handle the display of text also. Using OnDrawItem I am getting the
>> >>text to be overlapped.
>>
>> >>So basically I want all the functionality which CListCtrl provides
>> >>except drawing the background of the items being selected. I want the
>> >>item to be selected in blue color and I donot think it is good idea to
>> >>write so much code for that.
>>
>> >>Thanks
>> > Joseph M. Newcomer [MVP]
>> > email: newco...@flounder.com
>> > Web:http://www.flounder.com
>> > MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text -
>>
>> - Show quoted text -
>
>Hi,
>
>Thanks for the responses. The problem got solved by calling the
>setfocus function. The desired behaviour I was not getting before was
>because of calling the SetFocus function after EnsureVisible(0,
>FALSE); I called the SetFocus from the Parent of the CListCtrl, i.e
>main application using the CListCtrl handle and I got the blue color.
>
>I need that blue color, since on Vista with Vista theme, the gray
>color is not prominient and user do not get the felling that an item
>is being highlighted, so required this behaviour.
>
>Thanks a lot for the help.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/27/2008 12:24:35 PM
Reply:

Similar Artilces:

Select whose birthday is in a certain month
Hello, How can we make a parameter query to know whose birthdays are in March for example. What is the VBA in the form query. In this forum it is explain to filter from start date and end date, but what we need is to select birthday by month. Thanks in advance -- H. Frank Situmorang See the following sample database: http://www.datastrat.com/Download/Birthday2K.zip -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Frank Situmorang" <hfsitumo2001@yahoo.com> wrote in message news:CAA42C71-06A5-4157-87DD-529C40A2C94F@...

If/Then statement that returns colors
Is there a way to use an if/then statement to set a cell color? For instance =if(a2,3,red,blue) Thanx ...

Mouse move selection
A Windows interface question, here for want of finding anywhere better: (In eg an MDI document) when you hold the left mouse button down and move the mouse, it creates a selected area. When you move the mouse outside the client area it scrolls the window to increase the area. The scrolling is faster (within limits) as the mouse goes further away from the client area. This is a standard Windows interface. Problem: if a document has (eg) a very large horizontal extent, and the window and its parent are maximised, then effectively there is no "outside area" to enable one to a...

Text color
Hi All, When I open windows explorer and click on any word or folder way on the left , it is highlited in a very light blue, how can I change that color to say like dark blue like windows classic . Thank you. Carl G Hi, You would have to revert to a classic theme and then change the color for "selected items" in the advanced color properties of Personalization/Windows Color and Appearance. It's not customizable when running an aero theme. -- Best of Luck, Rick Rogers, aka "Nutcase" - Microsoft MVP http://mvp.support.microsoft.com/ Windows he...

Selective Column deletion #2
Hi, I'm not real familiar with writing code in Excel, so my question is probably fairly simple. I'm working with Census data and before importing it into SAS I want to clean it up a bit in Excel. The problem is that the Census summary tables give me three columns of information (an upper, lower, and estimate), when I only need one (estimate). The matrices I work with a usually in the 52x2000 range, so it gets very tedious to delete them by hand. Can excel handle a 'delete if' or 'select if, then delete' type of command. something like: delete if (column(contains(uppe...

Change bars color
Hello, I have a dinamic chart to show the cash flow position, a scrool bar chagne the data to the past and to the future (estimate), what I am looking for is, to have an easy identification of the estimated period I would like to chage the color of the bar. I am using an Stacked Column chart with two variables. any Ideias? -- regards from Brazil Thanks in advance for your feedback. Marcelo What I usually do when I want to show a column chart with one color within a certain range and another color elsewhere, is create two series, one each color, and use formulas to change on series ...

Can the color of the Command Bar be changed?
When you open up a window to show the contents of a folder, just below the usual Menu Bar is the Command Bar with menus like "Organize" and "Views." That Command Bar has a sickly blue-green color. Is there any way to change the color of the Command Bar? At the very least, I would like that color to be less saturated. -- Steven L. ...

Excel 2007 chart gridline color using vba
Hello, i want to apply a themecolor to a chart gridline using vba. I can apply normal colors (RGB, index) but not the theme color. Any idea? thx. berg Hi, Here are the various ways fo changing the colour. With ActiveChart With .Axes(xlValue, xlPrimary) If .HasMajorGridlines Then With .MajorGridlines .Border.ColorIndex = 5 'set color to blue .Border.Color = RGB(0, 255, 0) ' green .Format.Line.ForeColor.ObjectThemeColor = msoThemeColorAccent2 End With En...

summarizing selected data on a grid
I have a grid that I use to define attributes. I want to summarize only the selected "types" (i'm just using "x" to select on my grid). For example, by taking: A B C Type1 x Type2 x x Type3 x Type4 x x Type5 x x I want to output: A Type1 Type2 Type5 With similar output's for B & C. I could do it with if statements, but it's a pretty big grid, so I have a lot of blank rows. Is there a better way? Thanks. Hi! Have a look at your post: I suspect it has not reproduced as yo intended. The table of x's doesn't seem to match the scri...

CListCtrl Header height change??
CListCtrl Header height change?? Is it possible to change the height of a CListCtrl Header.? Thanks Markus ...

Selecting multiple public folders
Hi, I'm running Exch2003 and Outlook 2003. I need to add a user to a group of public folders. In both Outlook and Exchange System manager I can only select one folder at a time. Is there any way around this problem? regards, Pete Pete Halasovski <pjh43@cam.ac.uk> wrote: > Hi, > > I'm running Exch2003 and Outlook 2003. I need to add a user to a > group of public folders. In both Outlook and Exchange System manager > I can only select one folder at a time. Is there any way around this > problem? > regards, > > Pete Set up your permissions on the...

Account not selected when coverting leads
There are 3 options to chose when converting a lead - account, contact and opportunity. If you do not select the account, can you do so at another time? Is there any way to create the account after converting if it was not selected? The Opportunity has to be linked to a particular account as it is a required field in Opportunity. The best thing to do is to create a default account and call it "None" or anything you like and get the users to set the opportunities that has no accounts when creating the opportunities to it as a temp account then insert the correct info in the...

Print Selection in Word
Attempts to print a highlighted area via print "Selection" fails when that area includes a "Heading" Style along with a "Normal" style. No error, the print job is just not created. Seen in Word 2003 and 2007. Thanks in advance. Try updating the printer driver. Simply reinstalling the driver would also be worth trying. -- Stefan Blom Microsoft Word MVP "dkt" <dkt@discussions.microsoft.com> wrote in message news:C8CECF80-1D2D-4911-AA51-AADF78FB4FFE@microsoft.com... > Attempts to print a highlighted area via print "S...

EMail fonts, sizes and color
When I change my font type, size & color I can only click OK (tool-options). Once I close Outlook it returns to the default font type, etc. How can I change my default? CD <CD@discussions.microsoft.com> wrote: > When I change my font type, size & color I can only click OK > (tool-options). Once I close Outlook it returns to the default font > type, etc. How can I change my default? What version of Outlook, what message format, what Outlook editor, and in twhat window are you trying to make these changes? You're a little short on detail. -- Brian Tillman [...

Selected/Unselected Filter on User Security Child Windows GP10
In GP 10 the child windows within the Security Task Setup and Security Role Setup windows might be a little more user friendly if they had a filter for those items that are selected or not selected. Just a suggestion. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. h...

Problems with CListCtrl
I'm having trouble with a CListCtrl object. I'm trying to automatically set the selected items of the list from my code. I try the following statement: m_List.SetItem (pos, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0); The SetItem function returns non-zero, which supposedly means it was successful. However, I don't see any selection showing up. I even called RedrawItem on this list item, but it didn't help either. Anyone know about this? -Eric >I'm having trouble with a CListCtrl object. I'm trying to automatically >set the selected ite...

CTreeCtrl and CListCtrl problem
I use create a single document struct using MFC(explore style).The left of the window is CLeftView class(which inherit CTreeView).The right is CBrowserView which inherit CListView.I want to display the content of a directory in the right(CListview) when user click the item of the ctreectrl. In the LeftViw I add method "void CLeftView::OnClickItem (NMHDR* pNMHDR, LRESULT* pResult)" because I want to know which item be clicked by user. ////////////////Leftview////////////////////// CTreeCtrl& mtree=GetTreeCtrl(); HTREEITEM item=mtree.GetSelectedItem(); data=mtree.GetItemDat...

CListCtrl and sub item editting
Hi, Is it possible to implement CListCtrl sub item editting without creating a custom ctrl? I am using VS2003. TIA Tony >Is it possible to implement CListCtrl sub item editting without creating a >custom ctrl? Tony , There's no built-in support for this, so no, you have to provide some implementation for this. Have a look on sites such as CodeGuru and CodeProject, they'll have examples. Dave Thanks Dave, I've seen examples, I just wasnt sure if I needed my own ctrl. Regards Tony "David Lowndes" <DavidL@example.invalid> wrote in message news:k...

Selecting or deleting data
Hi all Is it possible to have a formula which recognises whether to select o delete data. Eg; A1 = xxx A2 = yyy A3 = zzz & C1 = (Nothing) C2 = (Nothing) C3 = zzz The results in E1,2 & 3 should have data in A1 and A2 but not A3 or C because Column C is for cancelled items and if it data in this colum matches then they should cancel each other out. Many thanks Joe -- Message posted from http://www.ExcelForum.com Hi try in E1: =IF(A1=C1,"",A1) and copy this down >-----Original Message----- >Hi all > >Is it possible to have a formula which recognises whether...

nested select problem
Dim a As Double Dim b As Double Dim c As Double a = 36.8 b = 44 select case a case 36.6 to 37 MsgBox "???" Select Case b Case 42 To 43 c = 26 MsgBox "hmm"'<<<<< this shud be shown as this is the point but it isnt giving me this msgbox :S :S Case 44 To 45 c = 26.5 Case Else End Select End Select what am i doing wrong? On 9/2/2010 8:24 PM, Sabbir Ahmad wrote: > Dim a As Double > Dim b As Double > Dim c As Double > a = 36.8 > b = 44 > select case a > case 36...

How to add clistctrl into clistctrl?
How to clistctrl into a clistctrl? For example like adding checkbox , combobox, i want to add clistctrl into a clistctrl ...

Filegroup restore used to selectively refresh filegroup in 2nd db.
I have TestDB1 comprised of 5 filegroups, which I've completed full/log backups to to restore as TestDB2. When data changes within one filegroup on TestDB1, I've taken a diff' + tlog backup and tried to use it to restore on TestDB2 so that same filegroup would be essentially refreshed. My execution sequence uses the last full, last diff', and tlog from TestDB1 but this doesn't work? Why? Is there a way to do this in SQL 2K8? Thx. -CqlBoy Message applying full backup: >Processed 16 pages for database 'FGTestRestore', file 'FGTest_fg2' ...

change colors in DialogBars
hi, How is it possible to change the colors in DialogBars, I mean something like OnCtlColor in simple dialogs, thanks, Behzad > How is it possible to change the colors in DialogBars, I mean something like > OnCtlColor in simple dialogs, Tried returning your own brush when nCtlColor argument in CDialog::OnCtlColor is CTLCOLOR_DLG ?, or am I misinterpreting your problem? Fahad Ashfaque hi, There is no problem in dialogs, I mean what to do if u want to change the colors in a DialogBar ? "Fahad Ashfaque" <FahadAshfaque@discussions.microsoft.com> wrote in message n...

Select distinct e-mail adresses
I want to extract some data from 2 tables One of the tables contains an email address. I want the query narrow down so that a single email address is only output once. What SQL statement can I use to get this result. e.g. data contains Field1 Field 2 Field3 EMAIL a c w2 test@test.com a d w1 test@test.com a c w5 test2@address.com I only want to output a c w2 test@test.com OR a d w1 test@test.com a c w5 test2@address.com -- Thanks in advance Hans Hans, How about something like this? SELECT Field1, Field2, Field3, EMAIL FROM (SELECT ROW_NUMBER() OVER (Par...

query return a randomly selected subset of records
Hello, I want to retrieve 10% of the records in a table, but want them to also be randomly selected. In other words, I want to randomly subsample a group of records. Does anybody know how this can be done, either in SQL or VBA? Thank you very much. This question would have been more appropriate in the MS Access Queries NG. You can select the TOP 10 PERCENT of the records ordered by the RND() function like: SELECT TOP 10 PERCENT Rnd([OrderID]) AS Expr1, Orders.* FROM Orders ORDER BY Rnd([OrderID]); -- Duane Hookom Microsoft Access MVP "BayDeltaDev" wrote: > Hello, &g...