Why does all text appear bold when adding controls to a new frame window?

I have been trying to solve this bug for some time now. When I make a
child window and place two Rich Edit Controls and a Button to it, the
text in it appears BOLD by default. The button is a "send" button
which copies all the RTF format text to the other RichEditControl. I
also have other buttons which make the characters inputted
Bold,Italic, or Underlined.

     But by default everything in the RichEdit Control as well as the
button texts are "BOLD". And that really does not serve the purpose.
Watever controls I add to the frame window, all its text is in BOLD. I
am sure it has nothing to do with the controls themselves. Only
something maybe with the window creation. I make the window using
CFrameWnd class. And it is also a SDI suppoting Doc/View architecture.

    So can u plz tell me a way out of this problem.I want all text of
the controls to be in normal form, not in BOLD.Please help.Thanx
nyways.
     
P.S. - Hey I am new to VC++.NET.
0
vivomagic (2)
5/27/2004 11:53:58 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
434 Views

Similar Articles

[PageSpeed] 44

How do you "make" a child window? If you create it in the dialog editor, it should get the
correct font. If you create it dynamically, the fundmental question is "why?", because
this is rarely needed. But if you must, you do the following

	CFont * f = GetFont();
	newcontrol.SetFont(f);

because there is an explicit SetFont done by the dialog-creation logic that assigns the
dialog font to each child contorl.

If you are creating controls in an MDI or SDI view, it suggests you should be using
CFormView.
			joe

On 27 May 2004 04:53:58 -0700, vivomagic@yahoo.com (Vivek) wrote:

>I have been trying to solve this bug for some time now. When I make a
>child window and place two Rich Edit Controls and a Button to it, the
>text in it appears BOLD by default. The button is a "send" button
>which copies all the RTF format text to the other RichEditControl. I
>also have other buttons which make the characters inputted
>Bold,Italic, or Underlined.
>
>     But by default everything in the RichEdit Control as well as the
>button texts are "BOLD". And that really does not serve the purpose.
>Watever controls I add to the frame window, all its text is in BOLD. I
>am sure it has nothing to do with the controls themselves. Only
>something maybe with the window creation. I make the window using
>CFrameWnd class. And it is also a SDI suppoting Doc/View architecture.
>
>    So can u plz tell me a way out of this problem.I want all text of
>the controls to be in normal form, not in BOLD.Please help.Thanx
>nyways.
>     
>P.S. - Hey I am new to VC++.NET.

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)
5/27/2004 4:50:59 PM
When you manually create a control or window and it displays text, the
default font used is "system font" which is a bold, fixed size font.

Using a template like the Resource (dialogs, etc) doesn't have this problem
becuase the tempalte will assign a font to the control/window.   You must do
the same when creating your own!

Relvinian
"Vivek" <vivomagic@yahoo.com> wrote in message
news:b790e5d4.0405270353.33f8f3aa@posting.google.com...
> I have been trying to solve this bug for some time now. When I make a
> child window and place two Rich Edit Controls and a Button to it, the
> text in it appears BOLD by default. The button is a "send" button
> which copies all the RTF format text to the other RichEditControl. I
> also have other buttons which make the characters inputted
> Bold,Italic, or Underlined.
>
>      But by default everything in the RichEdit Control as well as the
> button texts are "BOLD". And that really does not serve the purpose.
> Watever controls I add to the frame window, all its text is in BOLD. I
> am sure it has nothing to do with the controls themselves. Only
> something maybe with the window creation. I make the window using
> CFrameWnd class. And it is also a SDI suppoting Doc/View architecture.
>
>     So can u plz tell me a way out of this problem.I want all text of
> the controls to be in normal form, not in BOLD.Please help.Thanx
> nyways.
>
> P.S. - Hey I am new to VC++.NET.


0
m7217 (49)
5/27/2004 6:39:12 PM
Reply:

Similar Artilces:

Disappearing Combobox Text
Just opened up a number of existing databases and found the same problem in each. It is not possible to see the list of options in a ComboBox although the list is there. It is as if the fore colour is white and the back colour is white. If you select one of the options the text then appears in the control, black text on a white back ground. As a quick test i have created a new form and inserted a combobox, again the details of the options is not visible although the selected option text appears in the control after i make a random selection. I have checked all the visibility and colou...

Save formatted text from RichEdit control to rtf-file
Hi , How can I save the text from Rich edit control (2.0) to *.rtf , *.txt , *.doc I tried to get the buffer and putting the buffer to file, then saving the file but the text in the file is something different. Please let me know what to do? Here is the Code I ma using: mFile.Seek( 0, CFile::begin ); CString cBuffer2; int iTotalTextLength = m_oChatMessageControl.GetWindowTextLength(); HWND focusWnd = ::GetFocus(); m_oChatMessageControl.HideSelection(TRUE, TRUE); m_oChatMessageControl.SetSel(iTotalTextLength, iTotalTextLength); cBuffer2 = m_oChatMessageControl.GetSelText(); LPTSTR...

Creating a new field based on conditions
I have a database that tracks insurance information for our various vendors. Each insurance type has 2 fields - a requirement field (yes/no), and an effective field (some show an expiration date, some are yes/no). I have created a query that will return only the records for which insurance is required but is expired/missing. My problem is that I want to create a new field that is calculated based on the values in the other two fields in order to make the resulting report more user-friendly. For example, if GLRequired is True and GLExpiration is <Now(), I want the new field to say...

Having problem of Outlook not receiving new e-mails
I have been using Outlook for over 1 year with Comcast Broadband. Suddenly last week, I received a message that Outlook 2000 was experiencing a problem when receiving new e-mails and was going to shut down. I re-opened Outlook and it looked different and then it asked for me set up a profile and I canceled it. But after that window coming up a couple of times after it shut down, I decided to put in a new name and then I could not get to my old e-mails and it acted like a new set up. Then I really got frustrated. I was eventaully able to get back to my old e-mails and have been able t...

Day of week time control
Let's say I wanted something to occur at specific times (via DDE) on Sunday, a different thing on Monday -Tue, Wed, Thurs, Fri Sat and continue over and over. I see how I can know the day and time, but to use it in a formula escapes me. The use is for a simple area based light control in my house. Hi Vernon Maybe =IF(AND(WEEKDAY(NOW())=1,HOUR(NOW())>=8,HOUR(NOW())<=17),"Switch on","Switch off") -- Regards Roger Govier "vernon" <there@there> wrote in message news:%23gF0dmcrHHA.1404@TK2MSFTNGP03.phx.gbl... > Let's say I wanted ...

Controlling multiple TCP connections from Outlook 2003 clients
I've noticed that Outlook 2003 clients can have multiple TCP connections to the mailbox store on Exchange. As the following web link claims: http://www.windowsitpro.com/Article/ArticleID/46319/46319.html "This behavior is by design. Outlook can open multiple connections to parallelize its data communications with the Exchange server. The actual number of connections will vary according to the version of Outlook that you're using and the mode in which you're using it. For Microsoft Office Outlook 2003 in Cached Exchange Mode, you'll see four connections for the mailbox, ...

How to make a Add key disabled after adding one record unless
Hi, I have a form where I am adding records. There are two boxes where one has to put the lineitemnumber and another box where one has to put the description. Unless the above two boxes are filled in the Add command box need to be disabled. Now, the problem is after adding one record the Add button is enabled and I cannot disable it. I would appreciate any help to solve this. The error message is: The methos is not supported The following is the code: Private Sub cmdadd_Click() On Error GoTo Err_cmdadd_Click If (IsNull(Me.LineItemID) = True) Or (IsNull(Me.Description) = True) Then ...

Create static text from cell reference
Hey everyone... I have two columns of text which I'm combining in a third column using the formula (for C1, for example) =A1 & char(10) & B1 This gives me the contents of A1 on a line above the contents of B1 and works fine. What I NEED to do is somehow create column C as TEXT, not as a REFERENCED data from columns A and B. How do I create a cell that contains the actual TEXT content of another cell instead of a REFERENCE to the other cell? TIA... Select all the cells in "C" that have content. R-click them and select "Copy" then r-click again, sele...

How Can I Control When Messages are Downloaded from Server
I have the box "Check for messages every ___ minutes" unchecked (tools/options/general). Yet seemingly randomly, messages get downloaded a couple of times a day without my clicking "Sync." This is problematic due to the way I share the computer. Is there another setting I need to keep this spontaneous downloading from occurring? "Gripper" <Gripper@discussions.microsoft.com> wrote in message news:F22A9D3A-AFB5-4C85-B94B-79B109E4829E@microsoft.com... > I have the box "Check for messages every ___ minutes" unchecked > (too...

How can I sort duplicate text data in excel?
I have a large list of noames that I need to make sure that none of them are duplicated. Is there a way to have excel check it quisker than me reading every name until I find a duplicate? After selecting your data go to filter Advanced filter and check "Unique records only" You can even copy it to another area all uniques entries if you want to ... "TinaScheu" <TinaScheu@discussions.microsoft.com> wrote in message news:0399D580-7E69-4DF0-A969-E7FC5F777C70@microsoft.com... >I have a large list of noames that I need to make sure that none of them >are >...

Text Very Small When Replying
I'm able to change the text size when I'm replying to an email but how does one set the default size? No matter what I ser the font size to when replying it always reverts back to the smallest size when I do another reply. Look, I'm 54! I can't read that small text! James Are you using stationery? Also, Alt + T, Options, Compose,....... -- Ron Sommer MS MVP-Mail "JamesJ" <jjy@darwin_roadrunne0r.com> wrote in message news:OGt2E1OhKHA.1460@TK2MSFTNGP06.phx.gbl... > I'm able to change the text size when I'm replying to an emai...

Add new record through Form view
I have a table which is linked to a form, i would like to have a command button which will add a new record to my table. On the click of command button it should view the last empty row of my table in a form. On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian <RanjithKurian@discussions.microsoft.com> wrote: >I have a table which is linked to a form, i would like to have a command >button which will add a new record to my table. >On the click of command button it should view the last empty row of my table >in a form. The Click event should show [Event Proced...

Extract text from field
If you have a filed that contatins the following data:LastName, FirstNameWhere LastName has varing lengths. Can you run an update query to obtain just the LastName part of the field? If so, what would be the command?Many, many thanks in advance. On Tue, 6 Mar 2007 14:09:45 -0500, "Mary M" <none@no_email.com> wrote:>If you have a filed that contatins the following data:>>LastName, FirstName>>Where LastName has varing lengths. Can you run an update query to obtain >just the LastName part of the field? If so, what would be the command?>>Many, many thanks in...

Lexmark driver for Windows Vista??
does anyone know how to get a driver for my Vista program for a Lexmark X75 printrio? Any help appreciated? On Sun, 3 Jun 2007 15:07:39 -0500, "Kitty Stringfellow" <kikkimomjj@sbcglobal.net> wrote: > >does anyone know how to get a driver for my Vista program for a Lexmark X75 >printrio? >Any help appreciated? I'd suggest reposting your question in a newsgroup supporting Vista, or Lexmark. This newsgroup is for questions about designing relational database Queries in Microsoft Access. John W. Vinson [MVP] ...

Adding a certain text label in a excel chart
I am plotting in regularly basis a certain set of data in excel. Based on some data analysis this set of data has to be fitted to these equations: y = 1/x^a (1) and /or y = b/x^c (2) from data analysis, constants a, b and c are found and are placed lets say in cells A1, B1, C1. On my graph, I am putting then two small text labels where the real equation is displayed: smth. like: y = 1/ x^3.45 and / or y = 0.256 / x^3.12 The whole process is similar with excel curve fitting, when the “show equation on chart” is checked. Thank you in advance My question is: Can ...

Messenger emoticons
I have changed laptops and I did grab the old laptops custom emoticons folder (all in dt2 and id2 file endings.) But when i copy everything in the folder and add it to my new laptops custom emoticons folder... they get added (i.e. show up in the folder) but the images/gifs or names dont show up on the actual msn... *what gives*? Do I have to change the dt2 endings to gif or jpeg and go to "create" in msn for each of them to add them in? (I tried with one and it worked) Only problem is i have alot, like 203 dt2 files so changing the ending to .gif and adding each singu...

Duplicate Containers in AD after Exchange 2003 Migration
The scenario is: We migrated from an NT domain to a 2000 domain. Then about a year later we migrated from exchange 5.5 to exchange 2003. Once the migration was complete, we discovered that there were duplicate containers and OUs in "Active Directory Users and Computers" which were empty. For example, when we did the AD migration we created an OU hierarchy at the root of the domain. After the exchange migration we found a duplicate hierarchy structure under the Users container but it didnt actually contain any objects/information that was in the original OU structure. We don...

invoice for envelopes with windows
What invoice template can I use that will consistently place the name and mailing address on the invoice form so that it will always fit in the window of an standard #10 business envelope? There is no standard location for the window. I would suggest folding a piece of paper and measuring where the window is on the envelopes you use. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Mary" <Mary@discussions.microsoft.com> wrote in message news:68FC09EF-AA33-40D7-8472-1602F50D69BD@microsoft.com... > What invoi...

Adding extra data options
Is there a way to customize CRM to allow for adding another heading? I would like to add a second field similar to topic and would like to call it type. Can you add extra data fileds and types in CRM 3.0? You can add extra data fields to an entity. Go to entities customization at setting area. -- Marco Amoedo Plain Concepts http://geeks.ms/blogs/marco/ "xxdcmast" escribió: > Is there a way to customize CRM to allow for adding another heading? I would > like to add a second field similar to topic and would like to call it type. > > Can you add extra data ...

free ActiveX Control for MathML editing
I'd like to suggest free ActiveX Control for MathML creating/editing/rendering: http://www.hermitech.ic.zt.ua/hdata/fmlaxxp_home.php This ActiveX Control is a part of Formulator MathML Suite by Hermitech Laboratory: http://www.hermitech.ic.zt.ua. It makes it simple to develop new software products, keenly aware of the mathematical typesetting and MathML presentation/semantics rules. Vyacheslav Levitsky ...

Problems with MFC list controls
I have a large list control with many inventory control items displayed within. When someone single clicks on an item, it displays information about that item in another part of the dialog. I have a three-fold problem, the master list has multiple columns in it, in order to make the selection work properly, only column 0 can be selected, is there a way to make a valid row selection if you select an item using any of the other columns? Second issue is the highlight of the selection. Only column 0 in the list control will highlight, is there a way to make the entire row highlight when an...

Only new email window?
Is there a way that I could have a shortcut on my desktop that does not open the whole application, but rather ONLY open my new email window? I send out a lot of email, and I also have a lot of other apps running. Please let me know if that is possible. Thank you, Steve Steve F. <sf@flintind.com> wrote: > Is there a way that I could have a shortcut on my desktop that does > not open the whole application, but rather ONLY open my new email > window? I send out a lot of email, and I also have a lot of other > apps running. Create a shortcut whose target is: "%Pr...

Newbie needs help with new Exchange 2003 installation
I am TOTALLY new to Exchange. We just installed Exchange Server 2003 on a Windows 2003 domain. I have one (test) account set up and it appears to work OK but I keep getting an error message that says "Task "Microsoft Exchange Server" reported error (0x8004010F): 'The operation failed. An object could not be found.' I know, I know...How could I possibly not understand THIS message? I appear to be getting mail but I' can't be sure. How can I check to see what's causing this (and more important...what object it's looking for?) Thanks for any help! -Fran- ...

Can DrawFrameControl() draw XP style controls?
My application supports XP style controls. But I found the DrawFrameControl() can not draw XP style controls in my application. Can I draw XP style controls? ...

greyed out auto text
Created custom toolbar in Word with menu, autotext and email button as directed in "Quick sales letters for e-mail" demo video, but when I click email button, new email message appears in Outlook but auto text choices are greyed out???? Any ideas?? ...