From: Joseph M. Newcomer on 21 Apr 2010 10:54 Create a CEdit variable, then hand-edit the type to CMyEdit. ALWAYS remember "it just just program text" and if the tools don't give you the capability you need, there is a text editor! Personally, I think it is remarkably stupid that the class derivation tools are so poor in VS. Did you try just typing "CMyEdit" for the variable type? The later versions of VS allow this! But there is always a text editor! And it's just text! joe On Wed, 21 Apr 2010 00:28:26 -0500, "JCO" <someone(a)somewhere.com> wrote: >I'm using VS2008 and C++ code. > >I had to derive a class as (class CMyEdit : public CEdit) in order to trap >the the users key strokes and only allow numeric along with a decimal point. >I will need over 30 of these derived edit boxes on a dialog form. I don't >want to use the create feature at runtime because this makes it difficult to >place the edit box where I need them. > >Is there any way to drag this derived edit box at design time as if I was >dragging a regular edit box from the toolbox? > Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: JCO on 21 Apr 2010 14:38 Thanks everyone. That was easy now that I know what I'm doing. "Goran" <goran.pusic(a)gmail.com> wrote in message news:3fa3f15a-3417-4d78-b633-1b4aa51e9e52(a)k33g2000yqc.googlegroups.com... > On Apr 21, 7:28 am, "JCO" <some...(a)somewhere.com> wrote: >> I'm using VS2008 and C++ code. >> >> I had to derive a class as (class CMyEdit : public CEdit) in order to >> trap >> the the users key strokes and only allow numeric along with a decimal >> point. >> I will need over 30 of these derived edit boxes on a dialog form. I >> don't >> want to use the create feature at runtime because this makes it difficult >> to >> place the edit box where I need them. > > In the resource editor, just place a normal edit control from the > toolbox onto a dialog. Then... > > Using the IDE: > > Invoke "Add Variable..." command on the newly placed control (e.g. > right-click on it). "Add Member variable Wizard" should appear. In > "Variable type" field you can type any class name you want. In > "Category" combo, you should already have "Control". If not, pick > that. > > Manually: > > In CMyDialog class, add CMyEdit m_myEdit. In > CMyDialog::DoDataExchange, add DDX_Control(pDX, IDC_MY_EDIT, > m_myEdit). Frankly, that's not hard and you have 100% control on where > you put stuff and how it's typed in. That IMO beats +/- rigid IDE > automatism. > > Goran.
First
|
Prev
|
Pages: 1 2 Prev: CreateProcess Next: MFC SDI Application without a default �New Document� on Startup |