Turing Selection Off after inserting text into a Cedit Control???

CEdit::SetSel
void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );

Parameters
dwSelection
Specifies the starting position in the low-order word and the ending position in 
the high-order word. If the low-order word is 0 and the high-order word is -1, 
all the text in the edit control is selected. If the low-order word is -1, any 
current selection is removed.

CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
editbox->SetWindowText(OutString.c_str());
editbox->SetSel(-1, 0);

Why doesn't the above code turn selection off? 


0
NoSpam8358 (375)
3/24/2007 11:45:02 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
652 Views

Similar Articles

[PageSpeed] 24

See below...r
On Sat, 24 Mar 2007 18:45:02 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> wrote:

>CEdit::SetSel
>void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
>void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>
>Parameters
>dwSelection
>Specifies the starting position in the low-order word and the ending position in 
>the high-order word. If the low-order word is 0 and the high-order word is -1, 
>all the text in the edit control is selected. If the low-order word is -1, any 
>current selection is removed.
>
>CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
****
Since you are programming in MFC, you should generally forget the GetDlgItem exists.  If
you're writing more than one of these per year, you aren't using MFC effectively.  Create
control member variables using ClassWizard so you could write
	c_EditBox.SetWindowText(OutString.c_str());
and avoid the ugly GetDlgItem and cast.
****
>editbox->SetWindowText(OutString.c_str());
>editbox->SetSel(-1, 0);
>
>Why doesn't the above code turn selection off? 
*****
It is interesting that doing
	editbox->SetSel(MAKELONG(-1, 0));
sends the message
	SendMessage(EM_SETSEL, 0xFFFF, 0);
but the call
	exitbox->SetSel(-1, 0);
sends the message
	SendMessage(EM_SETSEL, 0xFFFFFFFF, 0);
which strikes me as more than a little odd.  Usually when I want to remove the selection,
I would do SetSel(0,0) to set the caret at the start of the string.  Have you tried that?
				joe
*****
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)
3/25/2007 1:27:30 AM
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:hejb03ptkcebeav3j5ln5cv6fbk49bjgit@4ax.com...
> See below...r
> On Sat, 24 Mar 2007 18:45:02 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> 
> wrote:
>
>>CEdit::SetSel
>>void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
>>void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>>
>>Parameters
>>dwSelection
>>Specifies the starting position in the low-order word and the ending position 
>>in
>>the high-order word. If the low-order word is 0 and the high-order word is -1,
>>all the text in the edit control is selected. If the low-order word is -1, any
>>current selection is removed.
>>
>>CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
> ****
> Since you are programming in MFC, you should generally forget the GetDlgItem 
> exists.  If
> you're writing more than one of these per year, you aren't using MFC 
> effectively.  Create
> control member variables using ClassWizard so you could write
> c_EditBox.SetWindowText(OutString.c_str());
> and avoid the ugly GetDlgItem and cast.
> ****
>>editbox->SetWindowText(OutString.c_str());
>>editbox->SetSel(-1, 0);
>>
>>Why doesn't the above code turn selection off?
> *****
> It is interesting that doing
 editbox->SetSel(MAKELONG(-1, 0));> sends the message
> SendMessage(EM_SETSEL, 0xFFFF, 0);
> but the call
> exitbox->SetSel(-1, 0);
> sends the message
> SendMessage(EM_SETSEL, 0xFFFFFFFF, 0);
> which strikes me as more than a little odd.  Usually when I want to remove the 
> selection,
> I would do SetSel(0,0) to set the caret at the start of the string.  Have you 
> tried that?

I just tried it, and it didn't work. I also tried  editbox->SetSel(MAKELONG(-1, 
0)); and that didn't work either.

I am adding the text during the construction of the DialogBox in the BOOL 
OutputDialog::OnInitDialog(). I pass the Text to the DialogBox constructor.


> joe
> *****
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
NoSpam8358 (375)
3/25/2007 2:48:01 AM
I just do SetSel(-1,-1) and the cursor ends up at the end of the line with 
no selection.

Tom

"Peter Olcott" <NoSpam@SeeScreen.com> wrote in message 
news:ZJiNh.26819$s8.575@newsfe21.lga...
> CEdit::SetSel
> void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
> void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>
> Parameters
> dwSelection
> Specifies the starting position in the low-order word and the ending 
> position in the high-order word. If the low-order word is 0 and the 
> high-order word is -1, all the text in the edit control is selected. If 
> the low-order word is -1, any current selection is removed.
>
> CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
> editbox->SetWindowText(OutString.c_str());
> editbox->SetSel(-1, 0);
>
> Why doesn't the above code turn selection off?
> 

0
tom.nospam (3240)
3/25/2007 2:59:21 AM
"Check Abdoul" <check abdoul at mvps dot org> wrote in message 
news:OYbCvuobHHA.260@TK2MSFTNGP02.phx.gbl...
>    If you are trying SetSel() in the dialog's OnInitDialog() member function, 
> then make sure your return FALSE at the end of the function if your EditBox is 
> the first child control in the z-order.

That did it thanks !!!

>
> Cheers
> Check Abdoul
> ---------------------
>
>
> "Peter Olcott" <NoSpam@SeeScreen.com> wrote in message 
> news:vplNh.36041$ia7.23164@newsfe14.lga...
>>
>> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>> news:hejb03ptkcebeav3j5ln5cv6fbk49bjgit@4ax.com...
>>> See below...r
>>> On Sat, 24 Mar 2007 18:45:02 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> 
>>> wrote:
>>>
>>>>CEdit::SetSel
>>>>void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
>>>>void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>>>>
>>>>Parameters
>>>>dwSelection
>>>>Specifies the starting position in the low-order word and the ending 
>>>>position in
>>>>the high-order word. If the low-order word is 0 and the high-order word 
>>>>is -1,
>>>>all the text in the edit control is selected. If the low-order word is -1, 
>>>>any
>>>>current selection is removed.
>>>>
>>>>CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
>>> ****
>>> Since you are programming in MFC, you should generally forget the GetDlgItem 
>>> exists.  If
>>> you're writing more than one of these per year, you aren't using MFC 
>>> effectively.  Create
>>> control member variables using ClassWizard so you could write
>>> c_EditBox.SetWindowText(OutString.c_str());
>>> and avoid the ugly GetDlgItem and cast.
>>> ****
>>>>editbox->SetWindowText(OutString.c_str());
>>>>editbox->SetSel(-1, 0);
>>>>
>>>>Why doesn't the above code turn selection off?
>>> *****
>>> It is interesting that doing
>> editbox->SetSel(MAKELONG(-1, 0));> sends the message
>>> SendMessage(EM_SETSEL, 0xFFFF, 0);
>>> but the call
>>> exitbox->SetSel(-1, 0);
>>> sends the message
>>> SendMessage(EM_SETSEL, 0xFFFFFFFF, 0);
>>> which strikes me as more than a little odd.  Usually when I want to remove 
>>> the selection,
>>> I would do SetSel(0,0) to set the caret at the start of the string.  Have 
>>> you tried that?
>>
>> I just tried it, and it didn't work. I also tried 
>> editbox->SetSel(MAKELONG(-1, 0)); and that didn't work either.
>>
>> I am adding the text during the construction of the DialogBox in the BOOL 
>> OutputDialog::OnInitDialog(). I pass the Text to the DialogBox constructor.
>>
>>
>>> joe
>>> *****
>>> Joseph M. Newcomer [MVP]
>>> email: newcomer@flounder.com
>>> Web: http://www.flounder.com
>>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>>
>>
>
> 


0
NoSpam8358 (375)
3/25/2007 3:43:38 AM
    If you are trying SetSel() in the dialog's OnInitDialog() member 
function, then make sure your return FALSE at the end of the function if 
your EditBox is the first child control in the z-order.

Cheers
Check Abdoul
---------------------


"Peter Olcott" <NoSpam@SeeScreen.com> wrote in message 
news:vplNh.36041$ia7.23164@newsfe14.lga...
>
> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
> news:hejb03ptkcebeav3j5ln5cv6fbk49bjgit@4ax.com...
>> See below...r
>> On Sat, 24 Mar 2007 18:45:02 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> 
>> wrote:
>>
>>>CEdit::SetSel
>>>void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
>>>void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>>>
>>>Parameters
>>>dwSelection
>>>Specifies the starting position in the low-order word and the ending 
>>>position in
>>>the high-order word. If the low-order word is 0 and the high-order word 
>>>is -1,
>>>all the text in the edit control is selected. If the low-order word 
>>>is -1, any
>>>current selection is removed.
>>>
>>>CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
>> ****
>> Since you are programming in MFC, you should generally forget the 
>> GetDlgItem exists.  If
>> you're writing more than one of these per year, you aren't using MFC 
>> effectively.  Create
>> control member variables using ClassWizard so you could write
>> c_EditBox.SetWindowText(OutString.c_str());
>> and avoid the ugly GetDlgItem and cast.
>> ****
>>>editbox->SetWindowText(OutString.c_str());
>>>editbox->SetSel(-1, 0);
>>>
>>>Why doesn't the above code turn selection off?
>> *****
>> It is interesting that doing
> editbox->SetSel(MAKELONG(-1, 0));> sends the message
>> SendMessage(EM_SETSEL, 0xFFFF, 0);
>> but the call
>> exitbox->SetSel(-1, 0);
>> sends the message
>> SendMessage(EM_SETSEL, 0xFFFFFFFF, 0);
>> which strikes me as more than a little odd.  Usually when I want to 
>> remove the selection,
>> I would do SetSel(0,0) to set the caret at the start of the string.  Have 
>> you tried that?
>
> I just tried it, and it didn't work. I also tried 
> editbox->SetSel(MAKELONG(-1, 0)); and that didn't work either.
>
> I am adding the text during the construction of the DialogBox in the BOOL 
> OutputDialog::OnInitDialog(). I pass the Text to the DialogBox 
> constructor.
>
>
>> joe
>> *****
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> 


0
Check
3/25/2007 4:16:22 AM
Ah, you didn't say you were doing it in OnInitDialog.  That changes things.  If your
control is the first non-static enabled control in the Z-order, then when you return from
OnInitDialog, the dialog manager will do a SetFocus() to it, which will cause all the text
to be selected.

There are several solutions for this.  One is to do the SetFocus yourself before you do
the SetWindowText, then return FALSE to indicate that the dialog manager should not try to
set the focus itself.  Another is to PostMessage a message that will reset the selection.
I'd suggest the first solution because it does everything before the dialog actually
appears, while the second will give a brief flash of selection before the selection
disappears.
				joe

On Sat, 24 Mar 2007 23:16:22 -0500, "Check Abdoul" <check abdoul at mvps dot org> wrote:

>    If you are trying SetSel() in the dialog's OnInitDialog() member 
>function, then make sure your return FALSE at the end of the function if 
>your EditBox is the first child control in the z-order.
>
>Cheers
>Check Abdoul
>---------------------
>
>
>"Peter Olcott" <NoSpam@SeeScreen.com> wrote in message 
>news:vplNh.36041$ia7.23164@newsfe14.lga...
>>
>> "Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
>> news:hejb03ptkcebeav3j5ln5cv6fbk49bjgit@4ax.com...
>>> See below...r
>>> On Sat, 24 Mar 2007 18:45:02 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> 
>>> wrote:
>>>
>>>>CEdit::SetSel
>>>>void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );
>>>>void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );
>>>>
>>>>Parameters
>>>>dwSelection
>>>>Specifies the starting position in the low-order word and the ending 
>>>>position in
>>>>the high-order word. If the low-order word is 0 and the high-order word 
>>>>is -1,
>>>>all the text in the edit control is selected. If the low-order word 
>>>>is -1, any
>>>>current selection is removed.
>>>>
>>>>CEdit *editbox = (CEdit *) GetDlgItem(IDC_EDITWINDOW);
>>> ****
>>> Since you are programming in MFC, you should generally forget the 
>>> GetDlgItem exists.  If
>>> you're writing more than one of these per year, you aren't using MFC 
>>> effectively.  Create
>>> control member variables using ClassWizard so you could write
>>> c_EditBox.SetWindowText(OutString.c_str());
>>> and avoid the ugly GetDlgItem and cast.
>>> ****
>>>>editbox->SetWindowText(OutString.c_str());
>>>>editbox->SetSel(-1, 0);
>>>>
>>>>Why doesn't the above code turn selection off?
>>> *****
>>> It is interesting that doing
>> editbox->SetSel(MAKELONG(-1, 0));> sends the message
>>> SendMessage(EM_SETSEL, 0xFFFF, 0);
>>> but the call
>>> exitbox->SetSel(-1, 0);
>>> sends the message
>>> SendMessage(EM_SETSEL, 0xFFFFFFFF, 0);
>>> which strikes me as more than a little odd.  Usually when I want to 
>>> remove the selection,
>>> I would do SetSel(0,0) to set the caret at the start of the string.  Have 
>>> you tried that?
>>
>> I just tried it, and it didn't work. I also tried 
>> editbox->SetSel(MAKELONG(-1, 0)); and that didn't work either.
>>
>> I am adding the text during the construction of the DialogBox in the BOOL 
>> OutputDialog::OnInitDialog(). I pass the Text to the DialogBox 
>> constructor.
>>
>>
>>> joe
>>> *****
>>> 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)
3/25/2007 6:15:06 AM
Reply:

Similar Artilces:

filling a control in a continuous form with a field from a table
I had posted this under "Access Reports" in error and received a response and responded. Please follow the dialog for an explaination of my question: Original Question: I have a form with the fields: date, client, atty, time, billable and description. All these fields update the Time Sheet Table. I want the atty field to automatically take the attorney's name from the table Attorney which contains one field called Atty. So for I can only figure out how to use a combo box to chose the Attorney table field. Response Received: Your combo box to select the at...

Pictures won't insert.
Got a problem with bmp and pcx pictures not wanting to "insert" into my Publisher 2000 (the stand alone version). OS is Windows 98SE The alert window that comes up is: Publisher cannot convert this picture. This is either because Publisher doesn't recognize the format of the picture you want to add or there was an error loading a graphic converter. Publisher has graphics converters that enable it to recognize most picture formats. Some of these converters may be missing. To install converters for word processors and graphics, please run Setup again. For information on runni...

Console Control
I used to be able to put /console after the IP address of the host and manage (root) it. But when I reinstalled my Windows XP PRO and tried to do it it tell me "The server name specified is invalid." But without the /console the IP address connects. Any ideas? By the way the "mstsc /console" commmand works. You need to install the newer client. -- Hope that helps, Dan Townsend This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send email to this address, post a reply to this newsgroup. Use of included script sam...

HTML / Text conversion
Hi, When i reply to an email in HTML format, i'd like Outlook converts it automaticaly in Text. Is this possible ? In Outlook express, there was a box to check in the options for that. I haven't found anything in Outlook 2002, that's why i have to change the format manually everytime i do a reply. Any ideas ? Thanks in advance -- Lucius Snow "I'm not here, this isn't happening" - Thom Yorke I don't think you can but you can edit your Toolbar to include a button "Plain Text" so you can convert it with a single click (which leaves you the option ...

Bug CEdit
I use a CEdit box and I've used LimitText and SetLimitText. But something strange is happening. When I type in more than 256 characters, the cursor jumps back to the beginning and I can type on from there. I'm not able to use the latest MFC version for professional reasons. Anybody knows why or knows a solution? THX Wim wrote: > I use a CEdit box and I've used LimitText and SetLimitText. But > something strange is happening. > When I type in more than 256 characters, the cursor jumps back to the > beginning and I can type on from there. I'm not able to use the ...

Select criteria based on the field name the user selects
Hi all, I am facing with aproblem where in i have a small access db with forms and reports now i want to change or set the where condition of a query based on the value the user selects from the form through a combo box. For ex:- if user is selecting Invoice_date then the where condition should search based on invoice date if the user selects any other field the querys where condition should search based on that particular field.Can any one help me in getting a solution for this. I have a sample database that shows how you can use various controls to set the filter of a query that i...

Displaying data based on Drop Down List Selection
Hello, hope someone can help. I have a list of records in Excel which are attributed to teams in my organisation. Say its a list of staff. What I need is to be able to send the file out so that a user can select from a drop down menu the team name and the list displays all the staff in that team. I know that they could just use a filter for this themselves but these these users are not even comfortable doing that!! I need to make is simple so wanted a big obvious drop down list with the teams in, they select it and see all the relevant records. Has anybody got any ideas? Would be ver...

text box frozen in Publisher
I have created a document and need to make changes; I can not change it; text box borders do not come up. Is the text box on the background perhaps? Ctrl+m. What happens when you select the text box and right-click? Are you getting an error? -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Ann" <Ann@discussions.microsoft.com> wrote in message news:EAE55C71-179F-4EE9-B21C-0203A27042A0@microsoft.com... >I have created a document and need to make changes; I can not change it; text > box borders do not come up. No...

Insert acrobat capability has disappeared on MS Publisher
MS Publisher 2003. I used to be able to insert a pdf file as an object. This capability has vanished from the "insert object" menu. This may be because my original Publisher has had an automatic update from version 11.5525.5606 to V 11.8212.8221. I have removed and reinstalled Publisher but the version level remains the same and the capability is still not there. My machine also has Acrobat V7 installeed but this has not changed. Have you tried Office Diagnostics in the Help menu? Right-click a toolbar, click customize, Options tab, see if Resetting menu and toolbar usage data...

tab control scrolling
I inherited an access form with a tab control with six tabs. When the user navigates from one tab to the next, the scroll bar position is in the middle and the tabs on the top of the tab control can not be seen unless the user scrolls up. Is there a method to automatically scroll to the top of the tab change event? Using the OnChange event of the Tabbed Control you'll need to set focus to the top/leftmost control on any given Page. Having said that, I have to say, IMHO, that having forms long enough to require scrolling up and down to see all content is very user-non...

Inserting Timer
Hi Guys, How do I insert a Timer control to the form? It is not visible with the other control. I am using Access 2007. Regards, There is no such thing as a Timer control in Access. If you set a form's Timer Interval property to any value other than zero, then the form's On Timer event will run at the specified interval (in milliseconds). "Nad" <Nad@discussions.microsoft.com> wrote in message news:79107B1D-4A1F-4779-B16A-EB0ACB3D50D2@microsoft.com... > Hi Guys, > How do I insert a Timer control to the form? It is not visible with the > other control. >...

Help
I am using store ops version 1.3.1010. We are using a windows and not an OPOS printer for our receipt printing. When we post a transaction, I would like the cashier to have the ability to enter how many copies of receipt to print before it prints. To do this I added the PrintReceipt hook to my windows registry, and have code added to my custom DLL that is triggered when this hook is activated. That piece is working fine. My code contains the following lines: Dim MyCount as Integer MyCount = InputBox("Enter receipt quantity", "Receipt Quantity") posSession.Configu...

Blank space gets inserted after text
For most columns, I am specifying a wrappable text format. Sometimes, after entering text in a cell, I get an extra blank line embedded at the end and I have to go back and manually close up the space. (So, if the text actually takes 2 lines, the row becomes 3 lines deep.) However, the problem is not consistent and I can't always reproduce it. Sometimes the height of the cell adjusts itself to the text just fine. I thought I may be inadvertently hitting the spacebar at the end of the last word, causing a wraparound, but that doesn't seem to be it. Any ideas? Hi Ros, Have you t...

Transfer data in an other text box field on a condition
Hi folks, I have a field on my report that show me a sum of "cartons to received" for each truck appointed. now I want to transfer that sum of "cartons to received" into another text box if the cartons are received. Anyone have an idea, how can I do this? If you need additional details, let me know. Thanking you in advance for your support Fred's ...

Attachment inserts in middle of text
I am using Outlook 2000 and when I insert an attachment to a mail message, it places it in the middle of my text. I am a new employee to a small company and we don't have much in the way of tech support. When I have used Outlook in the past I have always been able to set it up to where the attachment goes at the bottom in a separate window. How do I set up my Outlook to place the attachments at the bottom in a separate window? Tools>Options>Mail Format. Change it to something other than "Rich Text" "ddk" <dkiefer@theballpark.biz> wrote in message...

Take non-qualifying discounts Select Checks Screen default
Can anyone tell me how to default the checkbox to Take all non-qualifying discounts to always be checked? Eric, I'm trying to recall which window this is in but it doesn't really matter. There isn't anything in GP that defaults this value that I remember and so the solution is that you'd have to write a bit of VBA code to do this. Probably just one line to set it. My guess is the Window_AfterOpen() event and your line would look like: TakeAllNonQualifyingDiscounts = true This assumes that the field shows in VBA as I've guessed above. For further information on cu...

cannot insert page break
I have RMB - Reset All Page Breaks. Then I select a ROW, RMB - Insert Page Break. They page break is not inserted. I also tried to add a vertical/column page break with no luck. I tried this from the pull down menus as well (Insert - Page Break). Any idea what could be wrong? Using Office Professional Edition 2003 Thanks, Sean Try checking your page setup. When I have this problem, it's usually because I've forgotten I had set the "fit to page" feature. This feature is not compatible with setting your own page breaks (which is understandable). Set the page scaling to ...

Insert two points horizontal
I need to insert a shaded area to show if my data is falling between two points. I have 12 months on the axis and vertical numbers reflecting amounts done. I want a bar that show if we met the lowest goal and another to show if we meet exceeded the highest amount. Average number would be 430 and it should fall inbetween 420 and 450. Is it possible to do this? You could use a technique like this to add several horizontal lines (min, max, target): http://peltiertech.com/Excel/Charts/AddLine.html - Jon ------- Jon Peltier, Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ ...

File/folder drag/drop on List control
Hi, I am using a List control in an MFC application. How do I enable drag & drop of only files & folder on the List control (set to Report mode)? Regards, Steve Here is some code that might help you get started, but basically, you have an OnDropFiles() function, call DragAcceptFiles() and catch the WM_DROPFILES message: http://www.codeguru.com/cpp/controls/listview/dragdrop/article.php/c941/ // In message map ON_WM_DROPFILES() // In OnInitDialog() DragAcceptFiles(); // Handler function void CAddDataView::OnDropFiles(HDROP hDropInfo) { CDialog::OnDropFiles(hDropInfo); ...

Find&Replace *
The contents of my spreadsheet have an * at the beginning of the text in several of the cells (i.e. *Doe, John). When I attempt to do a Find&Replace specifying "*" as the find and "" as the replace, it simply wipes out everything. Is it possible to specify * as text and not as a wildcard? Or is it possible to create a macro that does the same thing? Any suggestions/hints, etc. would be greatly appreciated. Thanks, Steve Stringham Try this in the Find box: ~* -- HTH, RD ============================================== Please keep all correspondence within ...

Outlook 2003 very slow on domain controller setup (4 min statup)
Hey In short we have the following setup A Exchange 2003/dom´┐Żne server running on SBS 2003 R1. This DC is backup and is hosted in a remote location and is accessed through VPN. Additionally we have a primary Win 2000 DC which is placed locally on the netowork. These two DC is replicated. Our (primary) problem is that Outlook 2003 (on Windows XP machines) which is connected to the Exchange server with standard Exchange setup (no RPC over HTTP eg) is extreemly slow. It can take up to 4 minutes to start Outlook 2003 up. The machine is using almost 0% CPU time but is completly non-respon...

Highligting data in report by clicking control bottom on a form
Hi Folks, I've tried to figure out how can I highligt specific record row on a report, and this by clicking a check box on a form, but till now no success. Consequantly, if anyome knows how can I do that, please help me, Thanking you in advance for your help! Fred's On Thu, 08 Nov 2007 10:03:40 -0800, Fred's wrote: > Hi Folks, > > I've tried to figure out how can I highligt specific record row on a > report, and this by clicking a check box on a form, > but till now no success. Consequantly, if anyome knows how can I do > that, please help me, > >...

text boxes disappear off screen
hi, i have set up a new workbook containing various text boxes, all of which appear fine on my pc, and on of most of my colleagues' pc's. but on some of my other colleagues' pc's - some of the text boxes only become visible once they have clicked on the area containing the boxes, or, in some cases, not at all. they do appear on all printouts however. i'm at a loss as to why/how this is happening! cheers, mark Just a silly wild guess... I would guess that it has more to do with the video driver/video settings or even memory available. Any chance you can fiddle w...

Populating cells by selecting items from Combo Box? How to?
I have a combo box with three different house models. I need th spreadsheet to show the square footage of each side of the house fo each model when it is selected from the combo box. Basically I have four cells in a column, Side 1, Side 2, Side 3,Side for each side of the house. Then, next to each of those cells I woul like the values of the square footage to show up when that particula house model is selected from the combo box (the square foot #s ar always the same and can be inputted beforehand) I'm not sure if there is a way to do this without using much code(don' have much kno...

help with adding formatable text in bitmap file
I want to write a VC++ console application which opens existing bitmap image file, adds text to it and save it back to hard disk with different name.The text which is added should be a formatted text, for eg I should be able to select size,font, etc on the text. How can I do this? It has to be a windows program obviously. (It can be windowless, to make it appear to be console app). Anyway, you can load the bitmap and then user CRichEditCtrl::FormatRange to put RTF text on the bitmap. Here is a good example (By Henry Skoglund) on using FormatRange http://www.learnstar.com/AliR/RTFScaler3.zi...