CEdit selection focus

I need to implement something like a find/replace dialog.

So I select the text in the CEdit and then bring up a dialog to ask
the user what to do with the selection. The problem is that the
selection in the CEdit is only visible when the CEdit has the focus.
Since the dialog steals the focus, the selection is not visible and
the user does not know what (s)he is being asked about.

How can I keep the focus on the CEdit (or keep the selection visible)
while asking the user for input?
0
the44secs (141)
1/23/2008 2:53:12 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
439 Views

Similar Articles

[PageSpeed] 50

On Jan 23, 11:53=A0am, Alexander <the44s...@yahoo.com> wrote:
> I need to implement something like a find/replace dialog.
>
> So I select the text in the CEdit and then bring up a dialog to ask
> the user what to do with the selection. The problem is that the
> selection in the CEdit is only visible when the CEdit has the focus.
> Since the dialog steals the focus, the selection is not visible and
> the user does not know what (s)he is being asked about.
>
> How can I keep the focus on the CEdit (or keep the selection visible)
> while asking the user for input?

In case anyone has a similar problem, a solution is to create a
modeless dialog (rather than a modal one) and to set the focus on the
CEdit. It is not a perfect solution but, at least, the selection is
visible.
0
the44secs (141)
1/23/2008 4:50:24 AM
You could also pass the text into your popup dialog and display it there.

Tom

"Alexander" <the44secs@yahoo.com> wrote in message 
news:045969ef-c67a-4565-a847-397cd923b466@s12g2000prg.googlegroups.com...
On Jan 23, 11:53 am, Alexander <the44s...@yahoo.com> wrote:
> I need to implement something like a find/replace dialog.
>
> So I select the text in the CEdit and then bring up a dialog to ask
> the user what to do with the selection. The problem is that the
> selection in the CEdit is only visible when the CEdit has the focus.
> Since the dialog steals the focus, the selection is not visible and
> the user does not know what (s)he is being asked about.
>
> How can I keep the focus on the CEdit (or keep the selection visible)
> while asking the user for input?

In case anyone has a similar problem, a solution is to create a
modeless dialog (rather than a modal one) and to set the focus on the
CEdit. It is not a perfect solution but, at least, the selection is
visible. 

0
tom.nospam (3240)
1/23/2008 5:46:02 AM
To keep the selection visible, add the ES_NOHIDESEL style (there's an option for this in
the properties, I forget what it is called, but it is something like No Hide Selection)
				joe

On Tue, 22 Jan 2008 18:53:12 -0800 (PST), Alexander <the44secs@yahoo.com> wrote:

>I need to implement something like a find/replace dialog.
>
>So I select the text in the CEdit and then bring up a dialog to ask
>the user what to do with the selection. The problem is that the
>selection in the CEdit is only visible when the CEdit has the focus.
>Since the dialog steals the focus, the selection is not visible and
>the user does not know what (s)he is being asked about.
>
>How can I keep the focus on the CEdit (or keep the selection visible)
>while asking the user for input?
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)
1/23/2008 6:54:05 AM
On Jan 23, 3:54=A0pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
> To keep the selection visible, add the ES_NOHIDESEL style (there's an opti=
on for this in
> the properties, I forget what it is called, but it is something like No Hi=
de Selection)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 joe
>
> On Tue, 22 Jan 2008 18:53:12 -0800 (PST), Alexander <the44s...@yahoo.com> =
wrote:
> >I need to implement something like a find/replace dialog.
>
> >So I select the text in the CEdit and then bring up a dialog to ask
> >the user what to do with the selection. The problem is that the
> >selection in the CEdit is only visible when the CEdit has the focus.
> >Since the dialog steals the focus, the selection is not visible and
> >the user does not know what (s)he is being asked about.
>
> >How can I keep the focus on the CEdit (or keep the selection visible)
> >while asking the user for input?
>
> Joseph M. Newcomer [MVP]
> email: newco...@flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm

Thank you, Joseph. I had worked around it but it is good to know how
to do it properly.
0
the44secs (141)
1/24/2008 11:58:41 AM
Reply:

Similar Artilces:

Randomly selected numbers
Hi How can I randomly select six different numbers at any one time i.e lottery numbers. I have tried using the formula =INT(RAND()*49)+1, which works OK but I get repeated numbers, can anyone help? Keith Keith, Here is what I use for the California lottery to pick 5 non duplicate numbers from 47 possible... '------------------------------------------- Dim i As Long Dim j As Long Dim ArrTwo(1 To 47) As Long Dim ArrOne(1 To 5, 1 To 1) As Long Do While j < 6 Randomize (Right(Timer, 2) * j) 'Int((upperbound - lowerbound + 1) * Rnd + lower...

Swap selected cell values
I am looking for a simple macro to swap the contents of two selected cells. The cells might not be next to each other. I know what I want it to do, but I don't know vba well enough. If anyone has a moment to help, here is what I want to do. Select cell1, could be A1 Control-Click additional selection of cell2, could be C1 Hot-Key Macro to: Assign cell1 value to variable1 Assign cell2 value to variable2 Assign variable1 value to cell2 Assign variable2 value to cell1 Note: the specific cells being selected will not always be the same. So after the macro is run the values that started ...

Report on select general ledger accounts, that are not sequential.
There are many time when we need to review specific general ledger accounts. These accounts are not necessarily in sequential order, therefore we have to print much more than is needed or may separate reports. It would be helpful if a detail/summary trial balance report could be generated, using some type selection criteria other than account number,segment or date. Example: We have multiple general ledgers that relate to mortgages. These accounts can be income, expense, assets, etc. They cover a large range of general ledger numbers. I'd like to pull all accounts related to mort...

emails with Track in CRM selected go to Junk folders or stopped by
When I select Track in CRM while sending e-mails, it adds text like CRM:0000100004 in the subject. As a results some of the e-mails sent to customers were not received by them. Later on we founf out that they went to the Junk folder in one case. In another case, the corporate e-mail server blocked the message. Is there any way to hide the "CRM:..." from subject but still keep the tracking functionality? I recently changed the prefix from CRM to "PAS" - our company name. If thats the reason for e-mails are going to junk mail, I will know it soon. Is there any other r...

Select Multiple columns in combo box
I have a form which has the following fields on it called “currencyMonth” “invAmt” and “curr” which holds values: GBP, or EUR, etc. I also have a combo box which is a table of currencies and values listed as such: currencyMonth, rate, abbr. 1/1/ 2007 $1.87 GBP 1/1/2007 $1.27 EUR 2/1/2007 $1.90 GBP 2/1/2007 $1.50 EUR The “abbr” of the table above has the same values as “curr” on the form. The rate from the table of currencies is different for the currencyMonth. I’m trying to get the form to function as follows: afterUpdate of ‘invAmt, have the...

New user with focused direction! Will Excel and VBA do it?
First, the background - I am certain a code geek designed Newsgroup format and sign-up. Take a lesson from Yahoo. (This should seal my fate with the group.) OK, Debra, I'm here and on my feet, so far. I built my first userform with Debra's concise tutorial a couple weeks ago. Excel is intimidating; I lose my information input. Enough background. The design- A form to enter data, specifically related to wood properties - it's a hobby. Form settings which are saved between sessions. The settings process the data based on how it is obtained, three methods with one being customar...

Select Names Dialog box in OWA
Ok, so I know you can 'normally' just enter ' ', then find, then all names appear from the 'GAL' using OWA and IE. But I just saw an OWA with an alphabet listing along the top of the dialog box and the GAL being automatically generated in the 'Select Names -- Web Page Dialog' box. Where's that setting in Exchange 2003? Windows 2k3, w/Exchange 2k3. Not running SSL, either instance. Thanks in advance. ...

How to limit CEdit character?
I want to know how to limit the number of character a CEdit can accept since I look for the properties of text length but I could not found it? My application should only allow 4 characters. Thank you very much. Use the CEdit's SetLimitText() member funtion to limit the maximum entries to 4. Cheers Check Abdoul --------------------- "Landon" <Landon@discussions.microsoft.com> wrote in message news:A788B8A2-4778-4A45-872D-A0EE6547DFB0@microsoft.com... >I want to know how to limit the number of character a CEdit can accept >since > I look for the prope...

Sorting in select query. manually
Hello, I have a select query and I would like to sort on the field month. but I want to be able to specify the order myself (not descending nor ascending). how can I do this? thank you! You create a table with the data you which you would see in the Month field and the sort order that you want. You then join these two tables in the query and sort on it. Something like this: Month MonthSort Jan 12 Feb 11 Mar 3 and so on. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycl...

Excel & Word auto selection from menus
Ok, I'm a keyboarder, not a mouser. I use quick commands like the letter code or arrows on menus to speed along without the grab, aquire, click business. Excel & Word seem to be periodically (not always) automatically selecting menu items based on prior selections if I use arrow selectors. How do I turn this off? I get no help from "Help". Please reply to my e-mail address: legreenwood@hotmail.com. Thanks! Would love to get rid of this nuisance & keep speeding along. ...

select query of parent and child in one row
I have a parent table and a child table one parent has between 1 and 6 children in the child table I wont a query to have the parent and the child in one "row" how do I create that? thanks for helping me Your table structure is not correct for a relational database but this will get you there. This has three but you get the idea and expand on it. Place the table in the design grid as many times as you have field to combine. SELECT MultipleFieldData.x, MultipleFieldData.a & IIf(MultipleFieldData_1.b Is Null,Null," " & MultipleFieldData_1.b) & IIf(MultipleF...

Clause order in SQL select query
Are there any rules that govern clause order? Does the parser care? Obviously SELECT must be first but does WHERE have to precede ORDER BY? This question arises because I have a situation where the VBA code would be easier if the WHERE could be the final clause. That way I could have an unchanging SELECT, FROM, ORDER BY string and just tag the WHERE; on the tail. My thinking then turned to whether there is a mandated order for other clauses too. Is there an article somewhere to explain it? -- Len ______________________________________________________ remove nothing for v...

Outlook 2003, selecting Contacts question, long post, Please give feedback
We are using Outlook to manage a rather large client base. (it's not the best program for our use, but I'm not the boss) Right now the number stands at 900, with a possible 500+ more by the time we're done entering. I have to select clients each day and print them, 2 per page. I have to be in Detailed View to get the info I need to print. The "clicking and selecting" method is clumsy because if I click on the Initial column at the far right, it de-selects those already selected. Most days, I need to print 20-30 pages, (40-60 clients) I've resorted to just selecti...

Opening a Word Merge and Selecting Its Data Source from Access
I have a form that runs data files for Word Merges that create cover letters and floor plans (Word merges the data, and the actual floor plans are cut and pasted from an interactive floor plan online) and then opens the Word Merge documents. Currently I have each Word document hard-linked to a specific file, and the code saves each query to its respective file. That works fine if only one person is running the letters and floor plans. However, when we are busy, we have multiple people doing the assigning of exhibitors, and each is responsible for running the invoices, letters,...

Letter Writing Assistant selection based on Smart List Lookup
We had a great opportunity to use the letter writing assistance to send out a notice to any vendor used within the last 6 months. Using the smartlist lookup up we can see those vendors we have issued a check to based on Last Check date, but the Letter Writing Assistant only allows you to select ranges. ---------------- 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 ...

Select Case fails to fire with Data Users
Win2000 and Access 2003 I recently fixed the clutter of my form designs by going to a single subform control and a tab control. The subform has a null source object value which then gets loaded via the tab control's OnChange Event: Private Sub TabCtl_Change() If Me.Dirty Then Me.Dirty = False Select Case Me.TabCtl Case 0 Me.sfrmCtl.Visible = False Case 1 Me.sfrmCtl.Visible = True Me.sfrmCtl.SourceObject = "sfrmLocationsLocationIDs" Me.sfrmCtl.LinkMasterFields = "txtLocationID" ...

TRANSACTION and SELECT *
Hi all I have a question about SQL Transactions: For example, I have a table with 3 rows (ID 1, 2 and 3). Now I insert a new row within BEGIN TRANSACTION, and I do not commit yet. In another SQL Session, I try to select data. When I do SELECT * FROM Table, it is blocked. When I do SELECT * FROM Table WHERE ID = 2 I get a result. How can I make SELECT * FROM Table possible even when there is a open Transaction ? Of corse I only expect to get the ID's 1, 2 and 3 back and not the new row. I have looked about IsolationLevel, but this does not help. Thanks for any comments ...

When Select, do not download message
When i select a message at Outlook XP, Outlook will download the message automatically. That was not happened before. Sometime i need to remove 10 or 20 messages without downloading it, but when i select them, it will take long time that outlook will first download it. (the envloper icon is in full) How can i change that! ...

Create a search folder to look at all emails in one folder and selected criteria in other folders
Hi! Is is possible to create a search folder that shows ALL the email in the Inbox while only showing the unread email is other folders and subfolders? I would like to use this as a modified Inbox. Thanks, PJW I don't think you can do that since a search folder only allows one set of criteria. <phil.whitacre@cox.net> wrote in message news:1144603155.163778.133800@z34g2000cwc.googlegroups.com... > Hi! > > Is is possible to create a search folder that shows ALL the email in > the Inbox while only showing the unread email is other folders and > subfolders? I wou...

Msg Box does not return Correct Focus back to Dialog
I have a Dialog based Applcn. on click of Btn1 of Dialog1, a new thread is generated & a Dialog2 is shown In Dialog 2, again of click of Some Btn, Dlg3 is shown In Dlg3, during data validation, when a MsgBox is shown using AfxMessageBox func, the focus does not return focus to Dlg 3, instead focus goes to Dlg 2 Why so Thanks in adv ...

selecting data from a list box
I have created a list box using the multi select function. What I would like to do is be able to highlight multiple items(not in any particular order) in the list box and then return their selection to cells M1, M2, M3 and so on. I tried writing in a macro code to do this but it didn't seem to help. I got the code from a previous posting but kep getting an error message about the ME function: Dim i As Long Dim j As Long With.Me.ListBox1 For i= 0 To .List Count -1 If.Selected(i) Then j=j + 1 me.range("A" & j).Value = .List(i) End If Next i end With End Sub D...

Marking Selected Time Frames on Charts
The task involves making comments about time periods where two to three line graphs suggest something significant. First thought was to simply draw vertical lines at the beginning and end of each time slice. But that requires drawing and may require a more steady hand than mine. I'm looking for something neat and fast. I like shaded areas for these time frames but that seems to be just a refinement in the drawing function; I still have to draw line. Any suggestions? I'm sure this is a pretty common issue that Excel probably has the capability of handling with little effort... if I jus...

Get Object ID of selected records
Hi, Is there any way to get object ID of all selected records from view. I need to pass objectId of all selected records to 3rd part site in query string on button click in CRM. Thanks, Pankaj Rana ...

Focus Change from Mailheader to body
Does anyone know how to catch the event from an inspector window (mail message compose window) when the cursor is placed into the mailheader? If I change the cursor from the mailheader to the body of the message, Microsoft does disable the builtin formatting buttons, the are reactivated when the cursor gets back into the body of the message. I wish to use this same event disable/enable my custom buttons in the ribbon. Anyone has an idea how to accomplish this? You might use a timer, and check at intervall what's enabled. Here's a sample for an API timer: http://www.v...

removing focus from the OK button on dialog app
I have a little dialog app that displays a message. "blah blah... has been done to your computer..please click OK to BLAH another thing to your computer". Because of the sensitivity of the BLAH thing that is about to be done, I need to ensure the user doesn't accidently press spacebar and launch the OK button by accident. I need to unfocus the OK button. Unfortunately the dialog application has only two things on it, the OK button and the CLabel field which displays the blah blah message. I suppose there are two solutions, but I don't know neither and would love your he...