Tab , setFocus doesn't hilite the text of the field

Hi,

I have many fields that should be filled by the user.
I added 2 more and I would like to change the tab order. I don't like using 
the numbers (after pressing Ctrl D, by clicking the fields I change the 
order) because I have too many fields and it takes time to do that. So I used 
the script, in each killFocus function I called setFocus function with the 
right field.

The problem is that this function brings the cursor to the right field BUT 
it doesn't hilite the value in that field so in order to change this value I 
have first to hilite it.

How can I hilite it by script?

Thanks a lot
0
liat_oren (16)
8/24/2004 12:37:04 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
1120 Views

Similar Articles

[PageSpeed] 2

"Liat" <liat_oren@yahoo.co.uk> wrote in message
news:3C256CAC-CE8B-4854-A77D-7AF2A4A76FD9@microsoft.com...
> Hi,
>
> I have many fields that should be filled by the user.
> I added 2 more and I would like to change the tab order. I don't like
using
> the numbers (after pressing Ctrl D, by clicking the fields I change the
> order) because I have too many fields and it takes time to do that. So I
used
> the script, in each killFocus function I called setFocus function with the
> right field.

You should really rethink your position on this. You can also open the *.rc
file as text and reorgnize the controls -- it may be easier than the IDE,
but both are far easier than trying to do it in code. If memory serves me,
changing the focus directly in a focus notification can be problematic.

>
> The problem is that this function brings the cursor to the right field BUT
> it doesn't hilite the value in that field so in order to change this value
I
> have first to hilite it.

This is not a SetFocus behavior, but a dialog box manager behavior.

>
> How can I hilite it by script?

See the documentation for WM_NEXTDLGCTL, CDialog::GotoDlgCtrl,
CDialog::NextDlgCtrl, CDialog::PrevDlgCtrl and GetNextDlgTabItem.

-- 
Jeff Partch [VC++ MVP]



0
jeffp (1711)
8/24/2004 12:55:34 PM
Thank you, I will do it that way.

How can I open the *.rc file as text ? How do I reorganize the controls?

Thanks a lot

"Jeff Partch [MVP]" wrote:

> "Liat" <liat_oren@yahoo.co.uk> wrote in message
> news:3C256CAC-CE8B-4854-A77D-7AF2A4A76FD9@microsoft.com...
> > Hi,
> >
> > I have many fields that should be filled by the user.
> > I added 2 more and I would like to change the tab order. I don't like
> using
> > the numbers (after pressing Ctrl D, by clicking the fields I change the
> > order) because I have too many fields and it takes time to do that. So I
> used
> > the script, in each killFocus function I called setFocus function with the
> > right field.
> 
> You should really rethink your position on this. You can also open the *.rc
> file as text and reorgnize the controls -- it may be easier than the IDE,
> but both are far easier than trying to do it in code. If memory serves me,
> changing the focus directly in a focus notification can be problematic.
> 
> >
> > The problem is that this function brings the cursor to the right field BUT
> > it doesn't hilite the value in that field so in order to change this value
> I
> > have first to hilite it.
> 
> This is not a SetFocus behavior, but a dialog box manager behavior.
> 
> >
> > How can I hilite it by script?
> 
> See the documentation for WM_NEXTDLGCTL, CDialog::GotoDlgCtrl,
> CDialog::NextDlgCtrl, CDialog::PrevDlgCtrl and GetNextDlgTabItem.
> 
> -- 
> Jeff Partch [VC++ MVP]
> 
> 
> 
> 
0
liat_oren (16)
8/24/2004 1:21:01 PM
"Liat" <liat_oren@yahoo.co.uk> wrote in message
news:31EE0F40-3705-4182-A635-1FDDDF24A30A@microsoft.com...
> Thank you, I will do it that way.
>
> How can I open the *.rc file as text ? How do I reorganize the controls?

In VS6 it's File->Open, Open As: Text. In VS7 it's File->Open->File,
Open->Open With...Source Code (Text) Editor. Then find the DIALOG or
DIALOGEX entry containing the controls, locate the control(s) you want to
move, select the lines describing the control(s), cut it/them and then paste
it/them after the line(s) describing the control your want to preceed them
in the tab order.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
8/24/2004 1:35:57 PM
Reply:

Similar Artilces:

settings tab
New system setup, and I set myslef up a the 1st and only user so far. Using the Web-based interface, I don't see the settings tab for configuring the system. What am I missing? If you have installed the Outlook client for CRM, you can not have Outlook open at the same time as the web interface, or you won't be able to view the Settings area (there's a workaround for this which you can find on the newsgroup). Also, once you can access your user record, open it and deselect "Restricted Access." -- Matt Wittemann http://icu-mscrm.blogspot.com "leec" wro...

Text Field
I have created a database using linked tables. There are no notes fields in those tables and I need one. I created a text field and entered a comment but that comment appears against every record but I want it to stay within the record it was recorded against. Anyone help ? Hi KC Where did you create the text field? Since the table is linked, you need to create the text field in your data source, where ever the tables actually reside. If you created the text field (box) on a form, it will not be bound to a particular record and thus it will show up for all of the records, similar to ...

Completing field on subform from command button on main form
This is a simplistic version of what I need to do. I have a form named frmCLIENT with a subform named sfFAMILY. On the form frmCLIENT I have a command butten and when I press it I want it to automatically complete a field named CHILDREN on the subform sfFAMILY with the word "NONE". Can anyone help me. Thanks, LDMueller The code for the button is Me.YourSubformName.Form.Children = "None" Me.YourSubformName.Form.Children.Requery 'so that you can see the results This assumes that the subform has only 1 record or that the record you want editing, is the first ...

addresses missing in To: field
Hope some has seen this. I have two users who recieved the same email from someone on the outside. They were both addressed in the To: field. Person A gets the email in his inbox and sees all the people listed in the To: field. In Person B's inbox he sees the same email only his email address is in the To: field and not person A's even though the send put both of their names in the To: field of the originating message. Thanks If user B isn't seeing this problem with other senders, either the sender in this case didn't put both in (perhaps resent the message after mi...

Populating FIELDS from another form(s)
I have one form were I create meetings, than another one were the individual is inputted (all works great - this is not the problem). I am trying to open a form(Travel) from that form by clicking on a button (This I already have and that part works). I want the newly opened form (Travel) to automatically populate a few fields (that you can not see on the form) that are the primary fields. example: [field1] = Me.[field1] and [field2] = Me.[field2]. Now if the record already exist then I want it to populate the form. So far I have this: Private Sub btnTravel_Click() On Error GoTo Err_btnT...

Vertical tabs in Property Sheet
Hi, I'm trying to create a property sheet wherein the tabs would be displayed vertically(on the left), rather than on top. The code is as shown below: BOOL CMyPropSheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); CTabCtrl *pTab = GetTabControl(); pTab->ModifyStyle(0, TCS_VERTICAL ); return bResult; } The problem with this is that the tabs are not displayed clearly. The edges are only vaguely visible till I click on them. Apprecaite if anyone could help me fix this. Also, can icons be displayed on the tabs rather than plain text...

Using TAB to change pages
I have a multiple page form. Each page is a seperate tab. How do I get the tab key or enter key to go to the next page in the form. When I tried event procedures, I used on LOSTFOCUS GOTO PAGE 2. When the macro was run, it came back with an error The cammand or action "GOTO PAGE" is'nt available now. with the expination that I may be read only database or an unconverted database. I am using 2007. So you are using a Tab Control? The tab control has multiple tab pages... Just set focus to the next tab page: TabPage1.SetFocus etc. This is different to having multiple page...

insert text data using function
Hi Guys, I need help on the following matter. Suppose i have two column A and B. Now when i insert some text in the A1 cell i want the data automatically set up in the B1 Cell. Fox example if i type Linux in the A1 cell "Open Source" will be automatically inserted in the B1 cell but if i insert windows "close source" will be inserted autoamtically. I tried with if function but no success. How can i achieve that? Mosaddeq Aziz You need to set up all of your possible data entry values for column A on Sheet2. Then in column B on sheet2, put the values you want aut...

CListCtrl large icons and text problem
Hi, I have a simple thumbnail view control based on CListCtrl and description of each item is a 3-line text. Unfortunately CListCtrl shows only two first lines, and the third one is visible only for selected item. How can I show 3 lines of text for all items ? How can I increase label width ? Thanks in advance, Kamil Karmil, Here is a control that might do what you'd like. Tom http://www.codeguru.com/listview/ReportCtrl.shtml "kamil" <kamildobk@xxxpoczta.onet.pl> wrote in message news:OndTGoS4DHA.3360@tk2msftngp13.phx.gbl... > Hi, > > I have a simple thum...

Text Box in Publisher
I am trying to create a text box in publisher with the measurement of 5.75 (h) x 5 (w). But publisher is making the height 5.751. How do I correct this? Is this even possible. Don't think it is possible... The .001 is so tiny it shouldn't make much difference. I can get a true 5.75 in Publisher 2000 but as soon as I copy/paste it goes back to 5.751 in 2002, 2003 and 07. Lines do the same. I can create a rectangle in a draw program, paste special into Publisher, ungroup, this rectangle will maintain the correct size. -- Mary Sauer http://msauer.mvps.org/ "Nikki" &l...

Is there a way to automatically resize a text box to the font size
I know how to set the font to automatically resize to the text box, but is there a way to automatically resize the text box to the font size? Very often I have the font size exactly how I want it and I have to adjust the text box so it's as tight to the text as possible. If there isn't an automatic way to do this, this feature should be included in the next version of Publisher. ...

subform fields
The main form is the Project Form. The subform represents the list of contractor's bidding the project, "bidder's list." I want to be able to distinguish which contractor is awarded the contract. Should I: a. create an "Awarded" field in the subform. The user can click the option button next to the awarded contractor? How would I set it up so that the user can only choose 1 contractor? or b. create a field on the main project form "Awarded contractor." How can I populate this combobox to list only the contractor's from that project&...

Parse(?) data from text file
I have a large text file that has hundresds (or thousands) of compiled questionairres that I want to convert to a more usable format (excel?). Here is what it looks like: ======================== Name: Joe Jones Address: 123 main comment: varies from blank to 20+ lines may have muliple paragraphs others: 8 or 10 other fields =============================== next questionnaire ====================== A couple of details: the separator line of ====s vary in length, the individual questionnaires are not always identical. Some have a couple of extra 'fields'. I envision a separat...

how do I convert an imported number to text
I am downloading data from a computer and wish to convert the number to text in an excel format eg: 0 = pump #1there is a series of numbers from 0 to nine and each one represents a different problem or failure of a piece of machinery Have you tried Find and Replace (Ctrl+H) -- Jacob "Lyn" wrote: > I am downloading data from a computer and wish to convert the number to text > in an excel format eg: 0 = pump #1there is a series of numbers from 0 to nine > and each one represents a different problem or failure of a piece of machinery ...

Auto jump to the next field
I have 10 fields of a designated length. Each needs only one number. When I fill up the present alpha field I'm typing into, I want the cursor to automatically jump to the next field without manually hitting the tab key. Thanks! Hi אלירם, AFAIK, that's not possible with a formfield. -- Cheers macropod [Microsoft MVP - Word] "אלירם" <@discussions.microsoft.com> wrote in message news:A0D98BC8-90B8-4FF6-B3B8-3B65AA1F493B@microsoft.com... >I have 10 fields of a designated length. Each needs only one number. > > When I fill up the presen...

sheet tab #2
I want to change font size of sheet 's name. What should I do? thanks ---------------- 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.com/office/community/en-us/default.mspx?mid=46907739-afa1-4f71-aca6-a3a341bef4ec&dg=microsoft.public.exc...

Publisher Text Box #2
I am looking for guidance on missing text from text boxes. I understand how overflow works, but this is a different problem. I am preparing a trifold pamphlet where it's important that my text fits into each third without overlapping the folds. I have one long text box filling each third. The only text box that displays all contents when printed is the center third. The first few letters of each line in the left third are curtailed at the left margin. The last few letters of each line in the right third are curtailed at the right margin. I have played around with the margins on bot...

How to combine text and the value in another cell?
Excel 2007 Lets say in A2 I have a calculated value of 2 in A1 I want it to say The total of XX = 2 This is what I tried: =CONCATENATE(The Total of XX =,A2) Gave me a "value" error what other approach should I try? tia dave Try this: ="The total of xx = "&A2 -- HTH, RD ===================================================== Please keep all correspondence within the Group, so all may benefit! ===================================================== "Dave" <dave@accessdatapros> wrote in message news:20C0AC3C-2CF3-49BC-8837-428F60A42692@microsof...

Changing Mail Format to HTML/Plain Text Doesn't "Stick"
I am having trouble with about 30% of the people I send e-mail with attachments to. If I manually force plain text (usually HTML is not an option) by changing the Internet Format property on the e-mail address, the attachments always come through. However, the default property seems to always be to let Outlook decide the best format (which must be RTF and people can't receive). Via Options/Mail Format, I have "Compose in this message format" defaulted to HTML. In Internet Format, I have Outlook Rich Text Options set to "Convert to HTML format". I've tried "Co...

Link between forms when the child field is part of the primary key causing crashes when creating new records in main form
This is access 2003. I'm making a form to create new records in a main table and simultaneously allow the user to create records linking them to data from a second. The link table data is shown as an embedded form within the main form. The link table has two columns to store foreign keys from the main table and a lookup table. I want it to have a compound primary key composed of the two foreign keys. The problem is that if I have the compoundPK set and then create a new record in the main form/table or have the secondary form set to link MainTablePK between the child and master forms ...

Why does this text automatically update?
I'm editing a newsletter used by former staff members created in Publisher 2003. (I'm using the same program.) There is a text box on each page in the same spot that says "Volume # Issue #." When I edit it on the first page it automatically changes on all the other pages. I don't think it is an object, embedded or linked or otherwise, because the "Edit Objects" option is greyed out. What is it, and how can I edit/replicate it? It's synchronized text. From Publisher's Help File: When you create a publication from a Publisher wizard or by using Publi...

Search box for text
I'm looking for a solution for an item search box for an inventory. I have a spreadsheet that I need to find "Name of product" and scroll it up to the bottom of my frozen pane. I've searched the discussions forum and tried several formulas, non have worked for me. In my frozen panes view, I'm looking to have a search box to type an item name in and have excel scroll it up to the bottom of the frozen pane. The item names are in column "D". Any takers????? Thanks, Allan Grates You are not going to be able to do this with formulas since formulas cann...

Activating Field Level Security
We were just wondering how to activate field level security. We are using advanced security, and it shows that field level security should be available on the menus, but we're not sure if this is an extra module or not. If so, any info or fact sheets would be appreciated. Thank you. The menu option "Field Level Security " is available in System Setup menu. Setup->System->Field Level Security "ConnollyandCo" wrote: > We were just wondering how to activate field level security. We are using > advanced security, and it shows that field level security...

Plain Text #3
Hi, I recently upgraded Outlook from 2000 to 2003. It now appears I have a problem with message formats in my INBOX. Messages that have been sent to me in Plain Text cannot be read, and for each message I have to manually change the format to HTML before text shows up. No problem with old messages that were sent in HTML or RTF. I don't understand this. Who can help ? tks Maarten ...

Text field size not matching
The help file says that custom fields text1-30 can have up to 255 characters but when I go to add that field to my Task Sheet it will only allow 128 characters. Any info would be greatly appreciated. Hi madsmom, I can add/view approximately 251 characters in the field when added to the table. Did you press enter when typing? If so, it will truncate at the first return. I hope this helps. Let us know how you get along. Julie Project MVP Visit http://project.mvps.org/ for the FAQs and additional information about Microsoft Project "madsmom" <madsmom@dis...