Change bk color of read-only CEdit

I am working on MFC using vs2k5. I place one edit control in SDI
application and write "WM_CTLCOLOR" message to change edit control
bk color and its working fine, but it doesn't work when read-only is
set on it.

Code for "WM_CTLCOLOR":

HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);

	// TODO:  Change any attributes of the DC here

	switch( nCtlColor )
	{
	case CTLCOLOR_EDIT:
		{
			if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
			{
				/*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
				hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
			}
			break;
		}
	}

	// TODO:  Return a different brush if the default is not desired
	return hbr;
}

How do I make it work when read-only is set to true?

Regards,

-aims

0
momer1141 (25)
8/16/2006 11:48:14 AM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
695 Views

Similar Articles

[PageSpeed] 58

"Neo" <momer114@gmail.com> wrote in message 
news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
>I am working on MFC using vs2k5. I place one edit control in SDI
> application and write "WM_CTLCOLOR" message to change edit control
> bk color and its working fine, but it doesn't work when read-only is
> set on it.
>
> Code for "WM_CTLCOLOR":
>
> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
> {
> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
>
> // TODO:  Change any attributes of the DC here
>
> switch( nCtlColor )
> {
> case CTLCOLOR_EDIT:
> {
> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
> {
> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
> }
> break;
> }
> }
>
> // TODO:  Return a different brush if the default is not desired
> return hbr;
> }
>
> How do I make it work when read-only is set to true?
>

Read-only edit controls use CTLCOLOR_STATIC.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
8/16/2006 11:58:43 AM
Also, you should not be doing this in the parent window; use the =WM_CTLCOLOR handler to
handle it reflected in the subclass of the edit control.  Much cleaner.
					joe

On Wed, 16 Aug 2006 06:58:43 -0500, "Jeff Partch" <jeffp@mvps.org> wrote:

>"Neo" <momer114@gmail.com> wrote in message 
>news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
>>I am working on MFC using vs2k5. I place one edit control in SDI
>> application and write "WM_CTLCOLOR" message to change edit control
>> bk color and its working fine, but it doesn't work when read-only is
>> set on it.
>>
>> Code for "WM_CTLCOLOR":
>>
>> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
>> {
>> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
>>
>> // TODO:  Change any attributes of the DC here
>>
>> switch( nCtlColor )
>> {
>> case CTLCOLOR_EDIT:
>> {
>> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
>> {
>> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
>> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
>> }
>> break;
>> }
>> }
>>
>> // TODO:  Return a different brush if the default is not desired
>> return hbr;
>> }
>>
>> How do I make it work when read-only is set to true?
>>
>
>Read-only edit controls use CTLCOLOR_STATIC.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/16/2006 4:51:06 PM
And, although I might be reading the code wrong, it seems like you are
creating a new brush each and every time the OnCtlColor handler is called,
in which case you have a GDI resource leak and might quickly run out of
resources.

Mike


"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:q6j6e2d93r03a8s79etgn7ois51rcvkp4r@4ax.com...
> Also, you should not be doing this in the parent window; use the
=WM_CTLCOLOR handler to
> handle it reflected in the subclass of the edit control.  Much cleaner.
> joe
>
> On Wed, 16 Aug 2006 06:58:43 -0500, "Jeff Partch" <jeffp@mvps.org> wrote:
>
> >"Neo" <momer114@gmail.com> wrote in message
> >news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
> >>I am working on MFC using vs2k5. I place one edit control in SDI
> >> application and write "WM_CTLCOLOR" message to change edit control
> >> bk color and its working fine, but it doesn't work when read-only is
> >> set on it.
> >>
> >> Code for "WM_CTLCOLOR":
> >>
> >> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
> >> {
> >> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
> >>
> >> // TODO:  Change any attributes of the DC here
> >>
> >> switch( nCtlColor )
> >> {
> >> case CTLCOLOR_EDIT:
> >> {
> >> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
> >> {
> >> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
> >> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
> >> }
> >> break;
> >> }
> >> }
> >>
> >> // TODO:  Return a different brush if the default is not desired
> >> return hbr;
> >> }
> >>
> >> How do I make it work when read-only is set to true?
> >>
> >
> >Read-only edit controls use CTLCOLOR_STATIC.
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
8/16/2006 7:59:49 PM
> And, although I might be reading the code wrong, it seems like you are
> creating a new brush each and every time the OnCtlColor handler is called,
> in which case you have a GDI resource leak and might quickly run out of
> resources.

That indeed looks like to be the case.

---
Ajay

0
ajaykalra (6842)
8/16/2006 8:05:34 PM
Missed that.  Yep, it's going to leak like crazy.
				joe

On Wed, 16 Aug 2006 12:59:49 -0700, "Michael K. O'Neill"
<MikeAThon2000@nospam.hotmail.com> wrote:

>And, although I might be reading the code wrong, it seems like you are
>creating a new brush each and every time the OnCtlColor handler is called,
>in which case you have a GDI resource leak and might quickly run out of
>resources.
>
>Mike
>
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
>news:q6j6e2d93r03a8s79etgn7ois51rcvkp4r@4ax.com...
>> Also, you should not be doing this in the parent window; use the
>=WM_CTLCOLOR handler to
>> handle it reflected in the subclass of the edit control.  Much cleaner.
>> joe
>>
>> On Wed, 16 Aug 2006 06:58:43 -0500, "Jeff Partch" <jeffp@mvps.org> wrote:
>>
>> >"Neo" <momer114@gmail.com> wrote in message
>> >news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
>> >>I am working on MFC using vs2k5. I place one edit control in SDI
>> >> application and write "WM_CTLCOLOR" message to change edit control
>> >> bk color and its working fine, but it doesn't work when read-only is
>> >> set on it.
>> >>
>> >> Code for "WM_CTLCOLOR":
>> >>
>> >> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
>> >> {
>> >> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
>> >>
>> >> // TODO:  Change any attributes of the DC here
>> >>
>> >> switch( nCtlColor )
>> >> {
>> >> case CTLCOLOR_EDIT:
>> >> {
>> >> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
>> >> {
>> >> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
>> >> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
>> >> }
>> >> break;
>> >> }
>> >> }
>> >>
>> >> // TODO:  Return a different brush if the default is not desired
>> >> return hbr;
>> >> }
>> >>
>> >> How do I make it work when read-only is set to true?
>> >>
>> >
>> >Read-only edit controls use CTLCOLOR_STATIC.
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/16/2006 9:37:33 PM
Thanks for pointing out the gdi resource leak in my code. What I did to
resolve it is declared a private variable of type HBRUSH m_hbr in my
View class and initialized it in the ctor using the CreateSolidBrush.
For deleting it I call DeleteObject on the WM_DESTROY. Following is the
code:

void CNewMsgView::OnDestroy()
{
	CResizingDialog::OnDestroy();

	DeleteObject( this->m_hbr )
}

and code changes in WM_CTLCOLOR

HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	switch( nCtlColor )
	{
	case CTLCOLOR_STATIC:
		{
			if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
			{
				pDC->SetBkColor( RGB( 255, 255, 255 ) );
				hbr = m_hbr; // <== change here
			}
			break;
		}
	}
	return hbr;
}

Everything is working fine. I hope this removes the leak right?

Regards,

-aims

Michael K. O'Neill wrote:
> And, although I might be reading the code wrong, it seems like you are
> creating a new brush each and every time the OnCtlColor handler is called,
> in which case you have a GDI resource leak and might quickly run out of
> resources.
>
> Mike
>
>
> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
> news:q6j6e2d93r03a8s79etgn7ois51rcvkp4r@4ax.com...
> > Also, you should not be doing this in the parent window; use the
> =WM_CTLCOLOR handler to
> > handle it reflected in the subclass of the edit control.  Much cleaner.
> > joe
> >
> > On Wed, 16 Aug 2006 06:58:43 -0500, "Jeff Partch" <jeffp@mvps.org> wrote:
> >
> > >"Neo" <momer114@gmail.com> wrote in message
> > >news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
> > >>I am working on MFC using vs2k5. I place one edit control in SDI
> > >> application and write "WM_CTLCOLOR" message to change edit control
> > >> bk color and its working fine, but it doesn't work when read-only is
> > >> set on it.
> > >>
> > >> Code for "WM_CTLCOLOR":
> > >>
> > >> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
> > >> {
> > >> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
> > >>
> > >> // TODO:  Change any attributes of the DC here
> > >>
> > >> switch( nCtlColor )
> > >> {
> > >> case CTLCOLOR_EDIT:
> > >> {
> > >> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
> > >> {
> > >> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
> > >> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
> > >> }
> > >> break;
> > >> }
> > >> }
> > >>
> > >> // TODO:  Return a different brush if the default is not desired
> > >> return hbr;
> > >> }
> > >>
> > >> How do I make it work when read-only is set to true?
> > >>
> > >
> > >Read-only edit controls use CTLCOLOR_STATIC.
> > Joseph M. Newcomer [MVP]
> > email: newcomer@flounder.com
> > Web: http://www.flounder.com
> > MVP Tips: http://www.flounder.com/mvp_tips.htm

0
momer1141 (25)
8/17/2006 9:06:46 AM
> Everything is working fine. I hope this removes the leak right?

That should take care of the leak.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com




0
ajaykalra (6842)
8/17/2006 12:54:13 PM
Why not declare a CBrush?  Then you don't have to worry about deleting it; it will get
deleted automatically for you.
				joe
On 17 Aug 2006 02:06:46 -0700, "Neo" <momer114@gmail.com> wrote:

>Thanks for pointing out the gdi resource leak in my code. What I did to
>resolve it is declared a private variable of type HBRUSH m_hbr in my
>View class and initialized it in the ctor using the CreateSolidBrush.
>For deleting it I call DeleteObject on the WM_DESTROY. Following is the
>code:
>
>void CNewMsgView::OnDestroy()
>{
>	CResizingDialog::OnDestroy();
>
>	DeleteObject( this->m_hbr )
>}
>
>and code changes in WM_CTLCOLOR
>
>HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
>{
>	HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
>	switch( nCtlColor )
>	{
>	case CTLCOLOR_STATIC:
>		{
>			if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
>			{
>				pDC->SetBkColor( RGB( 255, 255, 255 ) );
>				hbr = m_hbr; // <== change here
>			}
>			break;
>		}
>	}
>	return hbr;
>}
>
>Everything is working fine. I hope this removes the leak right?
>
>Regards,
>
>-aims
>
>Michael K. O'Neill wrote:
>> And, although I might be reading the code wrong, it seems like you are
>> creating a new brush each and every time the OnCtlColor handler is called,
>> in which case you have a GDI resource leak and might quickly run out of
>> resources.
>>
>> Mike
>>
>>
>> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
>> news:q6j6e2d93r03a8s79etgn7ois51rcvkp4r@4ax.com...
>> > Also, you should not be doing this in the parent window; use the
>> =WM_CTLCOLOR handler to
>> > handle it reflected in the subclass of the edit control.  Much cleaner.
>> > joe
>> >
>> > On Wed, 16 Aug 2006 06:58:43 -0500, "Jeff Partch" <jeffp@mvps.org> wrote:
>> >
>> > >"Neo" <momer114@gmail.com> wrote in message
>> > >news:1155728894.848411.299890@b28g2000cwb.googlegroups.com...
>> > >>I am working on MFC using vs2k5. I place one edit control in SDI
>> > >> application and write "WM_CTLCOLOR" message to change edit control
>> > >> bk color and its working fine, but it doesn't work when read-only is
>> > >> set on it.
>> > >>
>> > >> Code for "WM_CTLCOLOR":
>> > >>
>> > >> HBRUSH CNewMsgView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
>> > >> {
>> > >> HBRUSH hbr = CResizingDialog::OnCtlColor(pDC, pWnd, nCtlColor);
>> > >>
>> > >> // TODO:  Change any attributes of the DC here
>> > >>
>> > >> switch( nCtlColor )
>> > >> {
>> > >> case CTLCOLOR_EDIT:
>> > >> {
>> > >> if( pWnd->GetDlgCtrlID( ) == IDC_TEXTMSG )
>> > >> {
>> > >> /*pDC->SetTextColor( RGB( 120, 0, 0 ) );*/
>> > >> hbr = CreateSolidBrush( RGB( 255, 255, 255 ) );
>> > >> }
>> > >> break;
>> > >> }
>> > >> }
>> > >>
>> > >> // TODO:  Return a different brush if the default is not desired
>> > >> return hbr;
>> > >> }
>> > >>
>> > >> How do I make it work when read-only is set to true?
>> > >>
>> > >
>> > >Read-only edit controls use CTLCOLOR_STATIC.
>> > Joseph M. Newcomer [MVP]
>> > email: newcomer@flounder.com
>> > Web: http://www.flounder.com
>> > MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/17/2006 6:27:16 PM
Reply:

Similar Artilces:

a status like "checking" to change to date format when completed
I am creating a DB that is for Tracking engineering drawings. I want to have a status field that has the following 1. not started 2. in process 3. in checking 4 complete / Date completed Is it possible to have the complete status change to a date somehow? I want to avoid having two fields, a status field and a complete field I would suggest that you may want to change that to have four date fields. DateReceived DateStarted DateReviewStarted DateComplete That way you can easily check its status in the process and get a complete timeline. but to answer your speci...

CComboBox
I've a dialog resource containing several combo-boxes, created with the CBS_DROPDOWNLIST style: COMBOBOX IDC_CMB_INPUT1,14,111,100,68,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0,HIDC_CMB_INPUT1 At runtime, I'd like to change some of these to CBS_DROPDOWN (to allow the user to add their own text) depending on the state of other things in the project. In the property page's OnInitDialog(), I call: CPropertyPage::OnInitDialog(); CComboBox* pCmb = static_cast<CComboBox*>(GetDlgItem(IDC_CMB_INPUT1)); pCmb->ModifyStyle(CBS_DROPDOWNLIST, CBS_DROPD...

read message
Hi to all How can I disable the option that reply automatic for read message ? thanx Tools->options->email options->tracking options. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Essam asked: | Hi to all | | How can I disable the option that reply automatic for read message ? | | thanx ...

Changing options
I am running 2000 server with 40 2000 pro machines and need to change the default email from outlook express to Outlook? any help would be appriciated. Cheers ...

Change colour once a certain time period passed
I record the date of when I send a letter. I send several hundred o these letters. Once 30 days passes, I need to send out a reminder t these people that receive the letters. I was thinking that perhaps th best way to do this would be to have the cells automatically chang colour to indicate that 30 days has passed. But as only a basi formula user in excel, whats the simpliest way to do this -- Diann ----------------------------------------------------------------------- Dianne's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3029 View this thread: http://www.e...

changing sheet size
We have a worksheet that is maxed out to 65536 rows & also lots & lots of columns. No need for that we could use 1000 rows & 20 columns. How can we do this? TIA -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "mmap hq" <mmaphq@netzero.net> wrote in message news:uHwBsMl$JHA.1336@TK2MSFTNGP05.phx.gbl... > We have a worksheet that is maxed out to 65536 rows & also lots & lots of > columns. No need for that we could use 1000 rows & 20 columns. How can we > do this? TIA > If you look...

Changing the icon in MFC
Hello all, I have an MFC application, and I am trying to change the little (16*16) icon. In most cases, I would just go to the image editor section in Dev Studio and change the combo box selection from 32*32 to 16*16. Unfortunately, in this case, there is no 16*16 selection. The 32*32 bit selection in the combo box is hard coded, so I can't adjust it... is there another way to do this? I was able to change the big icon, but when I view my application as a small icon, it still shows that annoying MFC default icon.. thanks to add a new image size just go to "Image" in the ...

change default fill color
I have been searching the net and the KB but can not find answer or solution to this problem. I want my excel cell auto fill color to default to light grey instead of yellow. Is this possible? And if so, how do I do it? Thanks for any help you can provide. Shawn You can create a new default template, with grey as the default fill colour: Create a new, blank workbook. Choose Tools>Options On the Colour tab, click on the yellow square Click Modify, select light grey that you want to use as the default, click OK To make yellow available, select the light grey square, and change it t...

Check if a form has changed since it was last saved
I am developing an application using an ms access front end and a visual foxpro 8 backend. The application uses adodb connections to add/ update/edit data in the back end database. When a user clicks the save button on main data capture form the user input is programmatically inserted into a new record or an existing record is updated by creating SQL INSERT INTO or UPDATE statements on the fly. I was wondering if anyone knew of an efficient way of coding a mechanism to check if the form had changed since the save button was last pressed. I guess this can be achieved by capturing the On Chan...

Any way to change the day headings in Calendar?
At the moment each column (in week view) is headed by the date in the format '16 September'. Can I alter that to show 'Thurs 16 Sept' or something similar? Also, can I have a bold heading for today's column? -- Murphy's ultimate law is that if something that could go wrong doesn't, it turns out that it would have been better if it had gone wrong. GB wrote: > At the moment each column (in week view) is headed by the date in the > format '16 September'. Can I alter that to show 'Thurs 16 Sept' or > something similar? Also, can I...

Cannot Omit or Change Name When Printing in Memo Style- Office 2003
Cannot Omit or Change Name When Printing in Memo Style by outlook 2003. Any help is appreciated. Leila Hello Leila, mmh, which name? Your name on the top? You could change it in the Account Options under Username. >-----Original Message----- >Cannot Omit or Change Name When Printing in Memo Style by >outlook 2003. Any help is appreciated. >Leila > >. > No, printing is pretty limited... You could hit forward or reply and print, then close the message. Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Vis...

Money 2005
In Money 2004 there was a lot of flexability in the information displayed for individual stocks in a portfolio. I have been unable to find much flexability in the display of stock info in Money 2005. For example in Money 2004 I had the number of shares of a particular stock multiplied by the change in the stocks value for that day to arrive at the dollar amount of change in a particular stock. I can't seem to find this ability in Money 2005. Can you help? In microsoft.public.money, jwd wrote: >In Money 2004 there was a lot of flexability in the information displayed for >i...

Change the font of Category Axis
I want to change the font Size of the category Axis. I require the VBA Code to do that as the default font is too large and so not every thing can be seen Thanks in advance Chirag Easiest way to get the VBA syntax for something is to turn on the recorder while you do that task. Depending what you meant by category axis, you want one of these: ActiveChart.Axes(xlCategory).AxisTitle.Font.Size = 8 ActiveChart.Axes(xlCategory).TickLabels.Font.Size = 8 - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ ____...

Change axis values
Excel 2002. Spreadsheet chart plots a cycloid, with x=r(t-SIN(t)) and y=r(1-COS(t)). The chart produced is correct. However, I would like the x-axis to display the values of angles (either degrees or radians) rather than the values calculated by x=r(t-SIN(t)). Ideas?? TIA Paddy I'm not sure the request makes sense, but here is what I would do. I would keep the same XY plot you currently have, hide the X axis (set everything on the Format Axis/Patterns tab to none), and generate a series that has points where you want ticks and labels, and use this as your X axis. Here are a...

Autofill: can it detect change in value?
Is there a way to autofill down a column, where the autofill detects a new value and uses that value, until the next time it hits a new value? Simple example: I want this: To look like this: Dave Dave Dave Dave Bill Bill Bill John John Try the below 1. Select the data range in ColA (say A1:A100). 2. Press F5. From 'Goto window'>Special> from Options select 'Blanks' and hit OK 3. This will select all blanks. 4. Now press = (equal sign) 5. Then press Up Arrow to reference the cell just above 6. Now press Ctrl and Enter ...

Changing Properties of Fields in Table
Below is part of a code that somebody had given me to change the property of a field (in this case to make the field a required field). fld1.properties("Required") = True What do I need to do if I want to modify this line of code to do the following: a) Change a field to have a DATATYPE of Number b) FIELD SIZE should be DOUBLE Any help will be appreciated. Toks You cannot change data types in that way. Your choices are: 1) Create a new field of the correct type, run an Update query to transfer the data from the old field to the new field, delete the old field then rename ...

Changing an icon in CListCtrl
I have a CListCtrl in report layout and I have 4 icons. When I refresh I delete all items and write them in again but the icons do not change. Any ideas? Chris Baker wrote: > I have a CListCtrl in report layout and I have 4 icons. > > When I refresh I delete all items and write them in again but the icons do > not change. > > Any ideas? > Have you got a small sample code to see what your doing? I assume you have an image list. Each item in the list points to an index on the image list to used. If you havent changed that index, you will need to replace the imag...

Retrieving Windows' color settings
How do I retrieve Windows' color settings? For example, the default Windows Text is black and background is white. How do I retrieve the color (RGB values) for the Windows background? Have a look at GetSysColor API Victor "Charles Tam" <CharlesTam@discussions.microsoft.com> wrote in message news:811FC86C-4703-433E-B529-A180F46CED79@microsoft.com... > How do I retrieve Windows' color settings? > For example, the default Windows Text is black and background is white. > > How do I retrieve the color (RGB values) for the Windows background? use SystemPa...

Change Multiple Contacts
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange How can I change the details within multiple contacts in a single action. i.e., company ABC changed their name to XYZ and moved to a new address. <br><br>I need to change ~250 cards with this example, and also a few other contact details. <br><br>Thanks to all. ...

Change SQL Server Collation
Please comment on determine whether or not to change GP SQL Server Collation and the possible path to do it. We had initial installed Great Plains on SQL Server 6.5 with suggested collation and sort order (binary order, case sensitive) back to ten years ago and then we had upgraded SQL Server into 7.0 and then SQL 2000 later. Then the collation in SQL 2000 was converted into strange Collation Name: Compatibility_50_409_0. Now I am planning to upgrade SQL Server and GP also. Is it good time for me to change the collation from Compatibility_50_409_0 to current suggested collation? What ...

change background-color depending on cell-content
Hello, There is one cell per row which can have six different contents. Depending on what there is chosen, I like to change the background-color from different cells in the same row. How can I do that? Is it possible without VBA? Please help me! Hi, Have you tried to use the "Conditional formating" In the menu select Format->Conditional Formating PS: I have a portuguese version so I don't know if the terms in english are those I mention, but they must be similar. >-----Original Message----- >Hello, > >There is one cell per row which can have six differen...

How to avoid the Beep when Enter key is pressed in CEdit control
This is a not-multiline CEdit control. I don't want that when I press Enter key, control to beep. I tried by using OnKeyDown event without calling the default handler, but it didn't work. Thanks Jaime "Jaime Stuardo" <jstuardo@softhome.net> wrote in message news:eJCIlEDcDHA.1580@tk2msftngp13.phx.gbl... > This is a not-multiline CEdit control. I don't want that when I press Enter > key, control to beep. I tried by using OnKeyDown event without calling the > default handler, but it didn't work. Try a WM_CHAR handler either instead or in addition... ...

Problem with file links changing
Good day all. Excel 2007. I have a number of workbooks in memory some having file links referencing a data file also in memory. I have code which firstly saves the current data file (constantly updating) at month end run and then "Saves As" to another directory with a different file name. It then closes the new file and re-opens the original so that processing can continue for the new month. However, my problem is that all files with links to the original data file have now changed to reference the Saved As file!! e.g. VLookup and HLookup. I have tried various avenues ...

How can you draw a shape when the values change each time??
See example with worksheet Change event proc: http://cjoint.com/?erkFfzkxwN HTH -- AP '-------------- Private Sub Worksheet_Change(ByVal Target As Range) If Intersect( _ Target, _ Union( _ Range("Center_X"), _ Range("Center_Y"), _ Range("Radius") _ ) _ ) Is Nothing Then Exit Sub With Me.Shapes("Circle1") .Top = Range("Center_Y").Value - Range("Radius").Value .Left = Range("Center_X").Value - Range("Radius").Value .Height = 2 * Range("Radius")...

Problem making versions of a table by changing sourse data in another workbook
Hello How to make a version of a table by changing source data in another workbook and retain original version of the table easily? I lose the original version of the table if I change the source data in the other workbook even if I make a copy of the original table workbook. I have to recreate all links if I make copies of the original table workbook and the source workbook. Hi! Have you tried making a "snapshot" of the worksheet? (Converting the formulae into their values - fixed forever - using copy/paste special values) Just don't do it unless you have a secure copy ...