Subclassing dynamically created controls

I have a created an edit box dynamically using the Create function in a class 
derived from CTreeView ( Explorer Style - CLeftView ).

Now I want to change the color of the edit box . I guess I need to subclass 
this window using SubClassWindow( ) .

I have derived a class from CEdit and using the derived class to create the 
control .

Can anyone please help me how to Subclass the edit control so I can change 
its background colour .

Thanks in advance .

Sujay

-- 
Sujay Ghosh
Bangalore, INDIA


0
12/28/2007 12:49:00 PM
vc.mfc 33608 articles. 0 followers. Follow

12 Replies
1022 Views

Similar Articles

[PageSpeed] 29

Sujay Ghosh wrote:
> I have a created an edit box dynamically using the Create function in a class 
> derived from CTreeView ( Explorer Style - CLeftView ).
> 
> Now I want to change the color of the edit box . I guess I need to subclass 
> this window using SubClassWindow( ) .
> 
> I have derived a class from CEdit and using the derived class to create the 
> control .
> 
> Can anyone please help me how to Subclass the edit control so I can change 
> its background colour .
> 
> Thanks in advance .

Sujay:

If you have created the control using the derived CEdit class then you 
do not need to subclass it. Subclassing is only needed for controls that 
are created from a template.

-- 
David Wilkinson
Visual C++ MVP
0
no-reply8010 (1791)
12/28/2007 1:05:59 PM
Hello,
It's an either or type of thing.  You can use the class wizard in MFC and 
derive the CEdit class, or you can subclass the window in question.  You 
usually do one or the other.  I prefer to derive the CEdit class and create a 
custom class, because I find it makes it nicer to work with the control I 
wish to edit.  I too have to dynamically create controls on a form (infact 
many are of a type that is derived from CEdit).

Regards,

James Simpson
Straightway Technologies Inc.
0
12/28/2007 1:20:00 PM
Well, if I ONLY derive a class from CEdit , how do I make the TreeView 
understand to handle the CDerivedEdit .

class CDerivedEdit: class CEDit
{
   // Handle WM_CTLCOLOR
   // Change the background colour to YELLOW
}

In my TreeView

CDerivedEdit m_MyEdit .
m_MyEdit.Create();

With this code the backgroud colour of my edit control remains white ; and 
DOES NOT change to the colour specified in the CDerivedEdit:OnCtlColor

To route the messages to CDeriveEdit , I thinnk we need to subclass the 
window .

Had this been a dialog , I would have called SubClassDlgItem and it has 
worked for me .

Please tell me how should I route the messages if I dont SubClass the 
control .

Thanks in advance ,

Sujay



-- 
Sujay Ghosh
Bangalore, INDIA




"James Simpson" wrote:

> Hello,
> It's an either or type of thing.  You can use the class wizard in MFC and 
> derive the CEdit class, or you can subclass the window in question.  You 
> usually do one or the other.  I prefer to derive the CEdit class and create a 
> custom class, because I find it makes it nicer to work with the control I 
> wish to edit.  I too have to dynamically create controls on a form (infact 
> many are of a type that is derived from CEdit).
> 
> Regards,
> 
> James Simpson
> Straightway Technologies Inc.
0
12/28/2007 1:30:05 PM
The following code should change the edit controls background color to YELLOW 

class CDeriveEdit: public CEdit
{
   // Handle WM_CTLCOLOR
   // Change the bacground to YELLOW

}

/* In the TreeView derived Class */

CDerivedEdit m_MyEdit ;
m_MyEdit.Create ( );

If I dont subclass the edit control, how does the message get routed to 
CDerivedEdit .

I have earlier acheived the same in dialogs, but added SubClassDlgItem( ) .

Thanks in advance ,

Sujay


-- 
Sujay Ghosh
Bangalore, INDIA




"James Simpson" wrote:

> Hello,
> It's an either or type of thing.  You can use the class wizard in MFC and 
> derive the CEdit class, or you can subclass the window in question.  You 
> usually do one or the other.  I prefer to derive the CEdit class and create a 
> custom class, because I find it makes it nicer to work with the control I 
> wish to edit.  I too have to dynamically create controls on a form (infact 
> many are of a type that is derived from CEdit).
> 
> Regards,
> 
> James Simpson
> Straightway Technologies Inc.
0
12/28/2007 1:37:03 PM
David / James 

The following code should change the edit controls background color to YELLOW 

class CDeriveEdit: public CEdit
{
   // Handle WM_CTLCOLOR
   // Change the bacground to YELLOW

}

/* In the TreeView derived Class */

CDerivedEdit m_MyEdit ;
m_MyEdit.Create ( );

If I dont subclass the edit control, how does the message get routed to 
CDerivedEdit .

I have earlier acheived the same in dialogs, but added SubClassDlgItem( ) .

Thanks in advance ,

Sujay

-- 
Sujay Ghosh
Bangalore, INDIA




"Sujay Ghosh" wrote:

> I have a created an edit box dynamically using the Create function in a class 
> derived from CTreeView ( Explorer Style - CLeftView ).
> 
> Now I want to change the color of the edit box . I guess I need to subclass 
> this window using SubClassWindow( ) .
> 
> I have derived a class from CEdit and using the derived class to create the 
> control .
> 
> Can anyone please help me how to Subclass the edit control so I can change 
> its background colour .
> 
> Thanks in advance .
> 
> Sujay
> 
> -- 
> Sujay Ghosh
> Bangalore, INDIA
> 
> 
0
12/28/2007 1:43:02 PM
"Sujay Ghosh" <SujayGhosh@discussions.microsoft.com> wrote in message 
news:088BB01B-62AD-44C6-9A0F-2CB71D176D74@microsoft.com...
> /* In the TreeView derived Class */
>
> CDerivedEdit m_MyEdit ;
> m_MyEdit.Create ( );
>
> If I dont subclass the edit control, how does the message get routed to
> CDerivedEdit .


Calling the CEdit Create function subclasses it for you.  MFC subclasses all 
windows that you create dynamially.

You need to set the control's parent window when you call CEdit::Create. 
The CTL_COLOR message is sent to that parent window that you specify.

-- 
Scott McPhillips [VC++ MVP] 

0
Scott
12/28/2007 2:06:26 PM
Dear Sujay,
I have achieved being able to paint the background colour of the CEdit box 
using a derived class perfectly!  Here is a snippet of code that I use for 
this purpose, because I know that alot of people who attempt to take over the 
painting of the control in MFC by making a derived class will fail at this 
step:

HBRUSH CEditTest::CtlColor(CDC *pDC, UINT nCtlColor)
{
    m_Brush.DeleteObject();
    m_Brush.CreateSolidBrush(m_StatusColour);
    pDC->SetBkColor(m_StatusColour);
	return (HBRUSH)m_Brush;
}

To briefly explain what the code does:
1) I start by "clearing" the CBrush object I am using, removing the colour 
and style I am using via DeleteObject
2) I call CreateSolidBrush passing to the function a color value of type 
COLORREF, so this is the colour that you want to paint the background of the 
edit box to.
3) I call pDC->SetBkColor which tells the GDI pointer for this control, to 
use the correct color when drawing the edit control again.
4) I call return (HBrush)m_Brush which basically returns a handle to the 
brush that I used to paint the control, which may be needed later.

Additional note : as mentioned earlier you will need to create member 
variables within the derived CEdit class that will hold the Brush that you 
will be using to paint the colour onto the control and a COLORREF value that 
gives MFC the precise colour you want to use when painting the control.
Here are some additional code snippets to look at:
m_StatusColour = RGB(211,211,211); // this code here causes the control to 
turn grey in colour

void CEditTest::UpdateCtrl()
{
    CWnd* pParent = GetParent();
    CRect rect;
    
    GetWindowRect(rect);
    pParent->ScreenToClient(rect);
    pParent->InvalidateRect(rect, FALSE);    
}
 You will want to create a member function called UpdateCtrl in your derived 
CEdit class.  You will call this function each and every time you want to 
update the colour of the control.  Essentially what the code does is it tells 
Windows that the current control (your derived control's) background area is 
dirty and needs to be updated.  e.g. telling Windows that your control's 
background color needs to be changed.

Hope this helps,

Regards,
James Simpson
Straightway Technologies Inc.
0
12/28/2007 2:18:00 PM
Sujay Ghosh wrote:
> David / James 
> 
> The following code should change the edit controls background color to YELLOW 
> 
> class CDeriveEdit: public CEdit
> {
>    // Handle WM_CTLCOLOR
>    // Change the bacground to YELLOW
> 
> }
> 
> /* In the TreeView derived Class */
> 
> CDerivedEdit m_MyEdit ;
> m_MyEdit.Create ( );
> 
> If I dont subclass the edit control, how does the message get routed to 
> CDerivedEdit .
> 
> I have earlier acheived the same in dialogs, but added SubClassDlgItem( ) .
> 
> Thanks in advance ,

Sujay:

You must use message reflection to have your derived edit control 
determine its own color, because WM_CTLCOLOR is normally handled in the 
parent.

See ON_WM_CTLCOLOR_REFLECT()

-- 
David Wilkinson
Visual C++ MVP
0
no-reply8010 (1791)
12/28/2007 7:40:40 PM
See below...
On Fri, 28 Dec 2007 06:18:00 -0800, James Simpson <JamesSimpson@discussions.microsoft.com>
wrote:

>Dear Sujay,
>I have achieved being able to paint the background colour of the CEdit box 
>using a derived class perfectly!  Here is a snippet of code that I use for 
>this purpose, because I know that alot of people who attempt to take over the 
>painting of the control in MFC by making a derived class will fail at this 
>step:
>
>HBRUSH CEditTest::CtlColor(CDC *pDC, UINT nCtlColor)
>{
>    m_Brush.DeleteObject();
****
Why?  Unnecessary, unless you are changing the brush, which you are not.  Once the brush
exists, you apparently don't need to do anything.  So deleting it is either redundant
(becuase it doesn't exist) or pointless (requiring you re-create it on the next line).
****
>    m_Brush.CreateSolidBrush(m_StatusColour);
****
Do this once, in your constructor, or alternatively, in the PreSubclassWindow handler
****
>    pDC->SetBkColor(m_StatusColour);
>	return (HBRUSH)m_Brush;
>}
>
>To briefly explain what the code does:
>1) I start by "clearing" the CBrush object I am using, removing the colour 
>and style I am using via DeleteObject
>2) I call CreateSolidBrush passing to the function a color value of type 
>COLORREF, so this is the colour that you want to paint the background of the 
>edit box to.
>3) I call pDC->SetBkColor which tells the GDI pointer for this control, to 
>use the correct color when drawing the edit control again.
>4) I call return (HBrush)m_Brush which basically returns a handle to the 
>brush that I used to paint the control, which may be needed later.
>
>Additional note : as mentioned earlier you will need to create member 
>variables within the derived CEdit class that will hold the Brush that you 
>will be using to paint the colour onto the control and a COLORREF value that 
>gives MFC the precise colour you want to use when painting the control.
>Here are some additional code snippets to look at:
>m_StatusColour = RGB(211,211,211); // this code here causes the control to 
>turn grey in colour
>
>void CEditTest::UpdateCtrl()
>{
>    CWnd* pParent = GetParent();
>    CRect rect;
>    
>    GetWindowRect(rect);
>    pParent->ScreenToClient(rect);
>    pParent->InvalidateRect(rect, FALSE);    
>}
> You will want to create a member function called UpdateCtrl in your derived 
>CEdit class.  You will call this function each and every time you want to 
>update the colour of the control.  Essentially what the code does is it tells 
>Windows that the current control (your derived control's) background area is 
>dirty and needs to be updated.  e.g. telling Windows that your control's 
>background color needs to be changed.
>
>Hope this helps,
>
>Regards,
>James Simpson
>Straightway Technologies Inc.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
12/29/2007 4:00:21 AM
I am creating an edit box dynamically beside the tree control.
 
The tree control is in the tree view
 
                 TREE VIEW

--------------------------------------------------------------------------------

Tree Control
      |
      |
      |---Label 1        Edit Box in question 
      |

--------------------------------------------------------------------------------
 
I have derived the edit box CMyEdit from CEdit .
 
and in the treeview class I have the following line in ON_TVNEXPAND
 
m_MyEdit.Create(WS_VISIBLE | WS_BORDER, rect, this, ID_MY_EDIT_BOX);
 
In the CMyEdit I have overriden WM_CTLCLOR_REFLECT  with the following code .
 
m_ColorRef has been set to YELLOW  in the classes constructor
 
pDC->SetBkColor( m_ColorRef);
return (HBRUSH) m_ColorRef;
 
But on execution I get a edit box which has a white background ; whereas I 
want a edit box with a yellow background.
 
Am I missing out on something.

Thanks in advance 
 
Sujay

-- 
Sujay Ghosh
Bangalore, INDIA




"David Wilkinson" wrote:

> Sujay Ghosh wrote:
> > David / James 
> > 
> > The following code should change the edit controls background color to YELLOW 
> > 
> > class CDeriveEdit: public CEdit
> > {
> >    // Handle WM_CTLCOLOR
> >    // Change the bacground to YELLOW
> > 
> > }
> > 
> > /* In the TreeView derived Class */
> > 
> > CDerivedEdit m_MyEdit ;
> > m_MyEdit.Create ( );
> > 
> > If I dont subclass the edit control, how does the message get routed to 
> > CDerivedEdit .
> > 
> > I have earlier acheived the same in dialogs, but added SubClassDlgItem( ) .
> > 
> > Thanks in advance ,
> 
> Sujay:
> 
> You must use message reflection to have your derived edit control 
> determine its own color, because WM_CTLCOLOR is normally handled in the 
> parent.
> 
> See ON_WM_CTLCOLOR_REFLECT()
> 
> -- 
> David Wilkinson
> Visual C++ MVP
> 
0
1/2/2008 9:50:01 AM
"Sujay Ghosh" <SujayGhosh@discussions.microsoft.com> wrote in message 
news:F5F27A60-72E6-4AEE-AD98-B40B18415A80@microsoft.com...
>I am creating an edit box dynamically beside the tree control.
>
> The tree control is in the tree view
>
>                 TREE VIEW
>
> --------------------------------------------------------------------------------
>
> Tree Control
>      |
>      |
>      |---Label 1        Edit Box in question
>      |
>
> --------------------------------------------------------------------------------
>
> I have derived the edit box CMyEdit from CEdit .
>
> and in the treeview class I have the following line in ON_TVNEXPAND
>
> m_MyEdit.Create(WS_VISIBLE | WS_BORDER, rect, this, ID_MY_EDIT_BOX);
>
> In the CMyEdit I have overriden WM_CTLCLOR_REFLECT  with the following 
> code .
>
> m_ColorRef has been set to YELLOW  in the classes constructor
>
> pDC->SetBkColor( m_ColorRef);
> return (HBRUSH) m_ColorRef;
>
> But on execution I get a edit box which has a white background ; whereas I
> want a edit box with a yellow background.
>
> Am I missing out on something.

Try calling pDC->SetBkMode(OPAQUE) so that the yellow background of text 
characters takes effect.  Also, the HBRUSH you return needs to be a real 
brush.  If you don't have one, return the one returned by 
CEdit::OnCtlColor() (the function yours calls).

If you want the entire background to be yellow, and not just for the 
characters you actually write, create a CBrush which has the yellow color 
and return that.  Don't bother calling SetBkColor() or SetBkMode().

-- David 


0
dc2983 (3206)
1/2/2008 2:03:48 PM
As I answered in your previous private email, the problem is that (a) you did not provide
the most important information of all, the DECLARATIONS of the variables involved and (b)
you are most likely not returning an HBRUSH.

The code will not compile if m_ColorRef is not a COLORREF.  It will not execute correctly
if m_ColorRef IS a COLORREF, because a COLORREF is not an HBRUSH and while you can lie to
the compiler and tell it that it is an HBRUSH, it isn't.  You need to return, as the
documentation specifies, an HBRUSH, not some random integer cast to be an HBRUSH.

Had you shown this code in your first message, and WITH the declarations, you would have
had an answer a long time ago.
					joe

On Wed, 2 Jan 2008 01:50:01 -0800, Sujay Ghosh <SujayGhosh@discussions.microsoft.com>
wrote:

>I am creating an edit box dynamically beside the tree control.
> 
>The tree control is in the tree view
> 
>                 TREE VIEW
>
>--------------------------------------------------------------------------------
>
>Tree Control
>      |
>      |
>      |---Label 1        Edit Box in question 
>      |
>
>--------------------------------------------------------------------------------
> 
>I have derived the edit box CMyEdit from CEdit .
> 
>and in the treeview class I have the following line in ON_TVNEXPAND
> 
>m_MyEdit.Create(WS_VISIBLE | WS_BORDER, rect, this, ID_MY_EDIT_BOX);
> 
>In the CMyEdit I have overriden WM_CTLCLOR_REFLECT  with the following code .
> 
>m_ColorRef has been set to YELLOW  in the classes constructor
> 
>pDC->SetBkColor( m_ColorRef);
>return (HBRUSH) m_ColorRef;
> 
>But on execution I get a edit box which has a white background ; whereas I 
>want a edit box with a yellow background.
> 
>Am I missing out on something.
>
>Thanks in advance 
> 
>Sujay
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
1/2/2008 5:05:51 PM
Reply:

Similar Artilces:

WMP 12 create playlist problem
I have WMP 12 on Windows 7. When I try to save a playlist I get an error message stating that there was a problem saving the playlist. I can't save any playlist, either by dragging songs one-by-one to the playlist list area on the right of the screen and clicking save, or by trying to create one through the playlist menu. So frustrating. I could do this before, this problem suddenly occured. I also can't rip CDs through WMP anymore for some reason, getting a similar error message. Any help would be greatly appreciated. Thanks That sounds like a corrupted library. In WMP...

Creating Waterfall Plots In Excel
Firstly apologies if I have allready posted this but I experienced problems just after hitting post and now cannot locate my message in the group. Anyway my question is this... Does anyone know of a method for producing waterfall plots using Excel. By this I mean creating a graph with three axis. An x, y and z. I am wanting to plot temperature against Engine Speed and torque. Ideally I would like torque along my x axis temperature as y with the engine speeds along the z axis. Thanks in advance for any suggestions. Andrew Check out http://tushar-mehta.com derek >-----Original Message...

Create User Wizard Insert Issue
I have placed a create user wizard on a page and added two textbox fields in addition for First name (id = FirstName) and Last Name (id = LastName) However when I try to insert all the information into my created table all I get is errors. I've tried for hours to understand various web examples and just am missing something. Below is my vb code on my code behind page. I keep getting "NullReferenceException was unhandled by user code" My database table does not accept nulls for First or Last names. But since these values have always been provided when "testin...

How do I get 4 postcards per page (blank -- me create)
If all the cards will be different. File, page setup, landscape. Arrange, zero margins, grid guides, 2 columns, 2 rows. zero spacing. Understand your printer's margin limitations. If all the cards will be the same, page setup, postcards. If you are using 2007, use the first landscaped Avery template. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "how do i ?" <how do i ?@discussions.microsoft.com> wrote in message news:3230BC40-86FD-4937-81A5-64D3AA3A8B1F@microsoft.com... > I see how to do what you s...

Subclassing
Hello, Im very new to c++ programming so pardon me if this is a dumb question and my bad english. I made a subclass from CListBox. I want to handle all the list controls derived from this class on one function, for example, void CListBox_SC::OnRButtonUp(UINT nFlags, CPoint point) { ..... } on this function I want to manage the OnRButtonUp event, and with a switch or if statement, select the code to execute. The following does work: SetCurSel(ItemFromPoint(point, ifp)); but the following comparison is never true, (IDC_LST_TIPO is a resource for one of the ListBoxes) UINT currLst = It...

Fonts in Dynamics GP using Vista are too big
Hi Folks My laptop has been changed from running on XP to now using Vista and I have found that the font inside Dynamics GP ver 10 sp 3 is now too large to display the full content of the field. I have used the smallest screen resolution and it has made no difference. Are you able to separately define the font that Dynamics GP should use for the data fields in a screen without having to use modifier all over the place. Many thanks in advance for any suggestions. Sheila Hi Sheila, I have been using GP 10.0 with Vista for long time now (probably an year and 3 months). I have not not...

Line control in VC 2003?
Hi, Is there anyway to place lines (seperators if you like) on a dialog box in VC 2003?. Vb(6?) has a line control that allows one to place lines on a form. I suppose I could mimic a line by using a static text control and resizing it so it looked like a line. The only problem is that I do not know how to change the background colour of the static text control. Does anyone know how to change the background/foreground of a control/dialog box? mtia >Is there anyway to place lines (seperators if you like) on a dialog box Use the picture control and size it to a line. If you want a ...

Custom Drawing CEdit : Subclassing
Hello experts, My objective is simple, but I'm not entirely sure what needs tweaking. I am using MSVC 6, and I would like to subclass the CEdit box so that it appears as the color-picker editbox of a PropertyGrid. There is a color box followed by three values. Like this: [###] 255; 192; 192 Where ### is just a color box representation of the value. So thus far, I've made a masked CEdit box, where I can edit the numbers (or click a button that visually sets the numbers from a different window), and I'm happy with that - but what I would like to do next is to subclass the dra...

How do you create a vendor tracking form for accounts payable pro.
I would like to use this form to keep track of vendor information for accounts payable functions (invoicing and receiving). The form would contain pertinent vendor information and automatically assign a vendor number. The vendor number could possibly be linked to a purchase order or invoice form to insure vendor tracking integrity. ...

MFC ActiveX control(.ocx file) on Internet exporer: File drag and drop
Hi, I am working on MFC ActiveX control(.ocx file) on Internet exporer, the control includes a list control which is enable to accept file drag and drop. But when control is hosted in IE, the drag & drop-ed file(image file) is handled by IE instead by the control, the IE just simply display the image file dropped. Could you tell me how to prevent the IE processing file, and to let the control handle it? Thanks a lot. Charlie Hi Charlie, Based on your description of problem, I understand you want to prevent IE processing the file drag&drop event and let your ActiveX control to ...

Dynamic Query
Hi! I am trying to dynamically modify my pass-through query containing a procedure call with 2 parameters. When I run my access app, I get this error: "Object or provider is not capable of performing reuqested operation." Below is my access code: Dim varItem As Variant Dim strSQL As String Dim cat As ADOX.Catalog Dim cmd As ADODB.Command Dim strMyDate As String, dtMyDate As Date dtMyDate = CDate([Forms]![ySalesHistory]![Start Date]) strMyDate = Format(dtMyDate, "yyyymmdd") strSQL = "procCustomerSalesandPayments '" & s...

Creating a form
...

Control Validation
I am trying to add a validation to a form that I have. To maintain unique course ID numbers, I have set the course ID number as primary key. The instructor has the authority to create their own course number based on what course numbers have not already been used. Over time, the course numbers expire and become available again. But that is a seperate course number that is also a primary key. Students can see the Course ID Number and select the course from there. The course number is used internally to track what courses have been offered, when and by whom. On the form that I am d...

How do I build a dynamic list?
I want to make it easier for my salesfoce to build a Bill Of Material. I have a sheet that the users will not be modifing which contains a full table from an SQL database on an MSSQL server. This is my master list of items available to be put into the BOM. I want to take the second sheet and put in a drop down list describing the product classes. My user will select the type of product and this will then need to search the other sheet and populate the list. For example, the user picks a product class of assembly. All assemblies are listed with a part number starting with 'AS'. S...

how do I create templates in Outlook email
Could someone please tell me how I can create new templates for Outlook email? I've tried and I can't get anything to work. Thanks! SB Open MS Outlook, Select File -> New -> Mail Message Design your Template Select File -> Save As 'Save As Type' change this to Outlook Template (*.Oft) Give the email message a name. Select the folder you wish to save the email. Click on Save To use this new template open Explorer (or my computer) find and hightlight the template you have just save and open it like you would any other file OR >-----Original Message-----...

Is it possible to create a number of charts in a single sheet in an excel?
Hi, Is it possible to create a number of charts in a single sheet in an excel using a macro? Please can somebody help me with the same? Thanks and Regards, Sobha On 26 Apr 2007 20:35:48 -0700, i.sobha@gmail.com wrote: >Hi, > >Is it possible to create a number of charts in a single sheet in an >excel using a macro? > >Please can somebody help me with the same? > >Thanks and Regards, >Sobha I'm sure it is, but I don't know how. I'm sure that there are Excel volunteers who do, though. Please scroll down the list of subject areas on the webpage and re...

Dynamic worksheet selection using messagebox
On the opening of an excel file with a number of worksheets named as follows: FDC Packs Covers I would like the following to occur: 1. A selection list of the current worksheet names (these may change so I want this to be dynamic) to be displayed in some kind of message box (radio buttons, listbox,any method would do). 2. On selecting one of these and pressing OK, a Microsoft file selection window will be displayed ( this is to allow me to pick up a file of raw data from a folder) 3. When a file is selected and OK is pressed, the sheet selected will become th...

Help with subclassing a RichEditCtrl
Hi folks, I could use some help. As a side project I am trying to write a DLL that will extend the functionality of an existing application that I do not have source code for, i.e., some autocompletion functionality, word lookup, etc. In the actual DLL, I am going to have to inject it into the existing app and then use FindWindow or something like that to subclass the existing RichEditCtrl. I need to be able to process the WM_CHAR and WM_KEYDOWN messages only. I started out by creating my own sample project using a RichEditCtrl in my project to code my object. I've now moved everythin...

Unable to create or send messages in Microsoft Outlook
Somehow I'm unable to create or send messages in Microsoft Outlook. The message window disappears off the desktop once I open it, eventhough I see that I have it open on the taskbar. Any advice or even a temporary workaround solution so I can respond to emails? Tried rebooting the computer and it didn't help. There is no error message and nothing out of the ordinary was done prior to this happening. The computer is using Windows 2000 I think and Microsoft Office 2003 is installed I think. I've tried searching google but no luck yet. Are you using dual monitors? Have...

creating sub accounts
I would like for there to be a separate security option to allow users to create sub-accounts and not top level accounts. We could then allow users more granular security policies. Thanks, Chris ---------------- 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. http://www.microsoft.co...

Dynamic Charts with sub-groups?
I frequently create dynamic charts via look-up tables using Excel 2007. I want to create dynamic charts capable of displaying results for different types of sub-groups without having blanks or zeros appearing in the chart. As an example, I want to create a dynamic chart that charts 4 age groups or 2 gender groups (but the gender chart cannot have any blanks or zero/NA fills). I have to think there's a way around it but my Excel skills aren't that advanced. ...

How do I name a range and then have that range be dynamic?
I want to select the entire contents of a worksheet, but that data set will change each time I open it as records will be added to it every day. I want to always choose all records, and there will never be any non-contiguous rows in the data or blank rows in it. So I can make a direct call to it and always get all of it by way of the named range. If A1 is the header for example for the first column you can use Range("A1").CurrentRegion.Select The same as Ctrl * -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "CellShocked" <ce...

WM_CREATE for a subclass
Hi All, I am fairly new to C++, although I have developed OO windows applications in the past using CTD and Power Builder. I am developeing an edit class based on a CEdit. I am trying to trap the WM_CREATE message to modify the style of the window (i.e. to make is multiline). For some reason the control does not appear to be getting the WM_CREATE message ( or at least it is not implementing the handler I have for it). At present I create an edit control on a form and the Subclass the edit. This appears to work as my user defined menu is used and my color modifications appear as requir...

Tab control questions
Using Office 2003 and Windows XP; When using a tab control: 1) Does it wrap automatically so that the tabs are more than one layer deep if additional tabs are inserted? 2) Is there a way to control when the tabs wrap to a second row or where the break will occur or is this just automatic (i.e. whenever it runs out of room)? 3) I'm sure I won't get anywhere near it, but what is the limit on the number of tabs? Thanks in advance. On Dec 17, 10:45 am, XP <X...@discussions.microsoft.com> wrote: > Using Office 2003 and Windows XP; > > When using a tab control: > ...

Create Form Dynamically in VBA
Without going into alot of details I need to create thru code and dynamically a FORM in Datasheet View with a recordsource is an exisiting query. Can this be done in code on the fly. I also need code that deletes or purges the same form object. thanks for any help. Why? It is not a good idea. Perhaps if you described what you want to do, we can help with a how. -- Dave Hargis, Microsoft Access MVP "Bret" wrote: > Without going into alot of details I need to create thru code and dynamically > a FORM in Datasheet View with a recordsource is an exisiting query. Can th...