473,767 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'DO CONTROLS USE PARENT'S FONT??

I have a user control called TextControl on which I have a RichTextBox
control.

TextControl1 is an instance of the User Control on a form.

I do the following in the form:

TextControl1.Fo nt = New Font(FontFamily .GenericMonospa ce, 10,
FontStyle.Regul ar, GraphicsUnit.Po int)

And the RichTextBox takes on the specified font - which is what I wanted but
why does it happen?

Does a control (RichTextBox) use the parent's (UserControl) font sometimes??

Thanks in advance
Nov 20 '05 #1
2 1486
Yep, controls will use the parents font until you change it. Like you did.
" SamSpade" <st************ **@REMOVEaol.co m> wrote in message
news:eX******** *****@TK2MSFTNG P11.phx.gbl...
I have a user control called TextControl on which I have a RichTextBox
control.

TextControl1 is an instance of the User Control on a form.

I do the following in the form:

TextControl1.Fo nt = New Font(FontFamily .GenericMonospa ce, 10,
FontStyle.Regul ar, GraphicsUnit.Po int)

And the RichTextBox takes on the specified font - which is what I wanted but why does it happen?

Does a control (RichTextBox) use the parent's (UserControl) font sometimes??
Thanks in advance

Nov 20 '05 #2
Actually I changed the usedcontrol's font and the control on it reflected
the change.
Thanks for the info
"yEaH rIgHt" <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
Yep, controls will use the parents font until you change it. Like you did.
" SamSpade" <st************ **@REMOVEaol.co m> wrote in message
news:eX******** *****@TK2MSFTNG P11.phx.gbl...
I have a user control called TextControl on which I have a RichTextBox
control.

TextControl1 is an instance of the User Control on a form.

I do the following in the form:

TextControl1.Fo nt = New Font(FontFamily .GenericMonospa ce, 10,
FontStyle.Regul ar, GraphicsUnit.Po int)

And the RichTextBox takes on the specified font - which is what I wanted

but
why does it happen?

Does a control (RichTextBox) use the parent's (UserControl) font

sometimes??

Thanks in advance


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2628
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML: **************************************************************
1
2589
by: Paul Gobée | last post by:
What is the parent element of a button (IE6 on Win, transitional mode)? Is it the BODY, the browser default stylesheet, or something else? Contra "body is parent-element": - Buttons with no style specified have a different font-size than the body's font-size. - If I change the body's font-size, a button with no style specified remains at the same font-size
7
3557
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET) template. Briefly -------------------------------------------------------------------------------------------- I need to create dynamically some controls on the forms, and display these
1
1278
by: et | last post by:
I have the situation where a C# dll is loaded and it provides some controls to display, I wrap the controls in some nice group boxes, and later on I dispose of the group boxes, making sure I remove the controls since I don't want them to be disposed of yet. If I do this a couple of time ie. wrapping controls in my group boxes and setting the references of the group boxes to nothing while keeping a reference to the controls, the controls...
1
1756
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As String Dim myDataListItem As DataListItem Dim myDatagridItem As DataGridItem Dim myCheckBox As CheckBox
4
7656
by: Jim in Arizona | last post by:
This doesn't make any sense to me. I'm hoping some SQL guru out there knows the answer. I'm making a help desk type database system. There's only two tables, one called TTickets and the other called TNotes. The Primay Key of TTickets is a one to Many to the Foreign Key of the TNotes table. In my VB code, I create a relation between the two tables so I can display several notes (from TNotes) with a single entry in the TTickets table. So...
0
2404
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
1
2035
by: Martin | last post by:
Hi all ! I use Visual Studio .NET 2005 SP1 (+ Updates for Vista) on Windows Vista. I have a strange problem in a WinForm application. In a UserControl, which inherit another UserControl (simply contains a SplitterPanel), I've added controls (most of them are TextBox with the property Anchors set to Left and Right) to Panel2. All theses controls fits in the UserControl and when I resize it, all the controls have the correct behavior....
7
1984
by: WT | last post by:
Hello, It seems that when a control is set into a ContentPlaceHolder in a page using a MasterPage, it's id is change and FindControl(ID) no more works, is it normal, how to override this or retrieve the controls OnInit handler with a FindControl ? Thanks again for help. CS
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.