how to change the font of some text in the text box to different size

hi all,

I am developing web application. I have some text in text box. Now i want to change the font of some text to different size than the other lines in the text box. How can i do this. Can anybody help me regarding this.

thanks in advance

0
sancti
12/4/2008 6:34:00 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

26 Replies
777 Views

Similar Articles

[PageSpeed] 22

I think you should use some other Text Input control beacause it is not possible in text box.

Try the Free text Box in the link below.

http://freetextbox.com/default.aspx

This will solve your problem
Muhammad Shoaib
Software Engineer,
Lahore, Pakistan
www.heartofpakistan.com (U/C)
--------------------------------
Mark it as ANSWER if it Helps U
0
mshoaib83
12/4/2008 6:58:15 AM
Hello,


This is not possible with a single text box.

As the properties will be reflected in an entire textbox, if you change the style of the text box, that will affect the entire text box and not the particular words....

Regarding the alternate options for a text box you can go with a HTML editor instead, which you can achieve this...

check out this at the following:

http://forums.asp.net/t/1352878.aspx


ukr

Mark this as Answer if it helps you, As some other might get the solution quickly...!
0
ukr
12/4/2008 7:30:07 AM

sancti:
I am developing web application. I have some text in text box. Now i want to change the font of some text to different size than the other lines in the text box. How can i do this. Can anybody help me regarding this.
 

Hello,

What you are trying to do is not applicable in ASPNET TextBox Control.. You can instead use Rich Text Editor such as FCKEditor, FreeTextBox or something that you can apply formatting to the contents... 

Just google each terms to get more information about the editors mentioned..

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
12/4/2008 7:39:05 AM

hi ukr,

   if i use fckeditor in my code, is it possible to load some text from database. Also  can u please tel me  how can i use this fckeditor in place of text box in my .aspx file.

thanks

0
sancti
12/4/2008 8:22:25 AM

 Hai

 You can use FCKEditor , Freetextbox control, Wyswyg editor , etc...,

 lot more , fckeditor.net or www.freetextbox.com then download the dll file and place it on 

 Bin folder and place the support folder for in your project folder , which contain supporting files

then you can use it as a normal controls as textbox... you can also place the control on your

Toolbox... Its also retrieve  data from database to you editor controls


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/4/2008 9:24:24 AM
Hello sancti,


If you use the editor controls, You just need to assign the value as for a normal text box and it will work fine.

FreeTextBox1.Text = "Text value returned from the DB";

Regarding the Use of the editor control to be added to our site...

Eg. take "FreeTextBox", download the dll and corresponding files from the site and copy to your application directory. Make sure that the FreeTextBox.dll is referenced in the application and also It will add a httpHandler in the Web.Config file of the application .

Make sure of the files, dll and httpHandler... then add the tag below the page directory


and then when you try the Intellisense, it will automatically give the tag to you

Also your page directive tag should have the ValidateRequest="false" to work with this. else you will get an error

Hope its very clear now... Let me know of you did not get any...!


ukr

Mark this as Answer if it helps you, As some other might get the solution quickly...!
0
ukr
12/4/2008 10:40:45 AM

hi ukr,

   thank u for ur reply.i have downloaded all the files of free text box. But i am finding difficult to inserting this into my project . Can u explain clearly how can i insert this into my project since i am new to this asp.net.

thanks,

0
sancti
12/5/2008 5:46:44 AM

 Hai

First place the freetextbox.dll file into you bin folder

 and there is ftb folder in your downloaded files is it 

copy the Ftb Folder and paste it on you project folder

and also in you toolbox Rightclick - > choose items -> select Browse -> select freetextbox.dll file -> ok ---> click ok

then it will added in your toolbox -> then drag and drop in your page....

That's alll , I think you can understand..

use  Freetextbox.text  , while u save to database ....


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 5:51:43 AM

sancti:
i have downloaded all the files of free text box. But i am finding difficult to inserting this into my project . Can u explain clearly how can i insert this into my project since i am new to this asp.net.
 

How To: Use FreeTextBox in ASPNET

http://www.a2zdotnet.com/View.aspx?id=28


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
12/5/2008 5:57:10 AM
Hello sancti,


Sorry for the late reply...!

Can you let me know what exactly you are getting problem when adding the freetextbox? So that it will be easy to resolve that.... else you can go with the FCK Editor if you find that as easy.. Here is the sample project which uses the FCK Editor

http://www.codeproject.com/KB/aspnet/HTMLEditor.aspx

Let me know if you still face any problem

Hope this helps...!
ukr

Mark this as Answer if it helps you, As some other might get the solution quickly...!
0
ukr
12/5/2008 6:23:42 AM

hi ukr,

   Thank u for ur reply, I will tel u where i am getting error. I have used the below mentioned link to insert the free text box into my project.  http://www.a2zdotnet.com/View.aspx?id=28

In think link, i am getting error on step 4. The error is : Could not load file or assembly 'FreeTextBox' or one of its dependencies. The system cannot find the file specified
So How  can i solve this. Can u please help me regarding this

thanks 

0
sancti
12/5/2008 8:25:33 AM

 Check whether you placed the Freetextbox.dll file in you Project -> Bin Folder

 and also make sure would you placed the supported folder in you project./..


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 9:12:31 AM

hi venkatu,

  Yes i have copied freetextbox.dll file to bin folder and also FCK editor my project folder.But its name is FredCK.FCKeditorV2.dll. Is change of name may be a problem?

thanks

0
sancti
12/5/2008 9:22:14 AM

 Hai Both  Fckeditor and Freetextbox are Independent control

of both of them has same functionality just use Freetexbox.dll and place it in Bin Folder

once you download the Freetexbox control , wat are the folder name you get List the folder...

and also paster you HTML Source code... , Mention the Error...

 

 


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 10:02:00 AM
The name of the dll is "freetextbox.dll" and add reference for the same.

Are you having the support files of css and images pointing to the controls?
Also did you change the web.config file of the application?
ukr

Mark this as Answer if it helps you, As some other might get the solution quickly...!
0
ukr
12/5/2008 10:17:56 AM

hi,

 Now the freetextbox is displaying.But it is not correctly displaying. Inside that freetextbox it is giving warning message. It is not installed correctly. I think the problem is with the support folder. I have extrated saved freetextbox directly to my project folder. And I gave full path in support folder. But still it is not displaying correctly. I have added all reference and changed web config. I cannot able to find where exactly the problem is. can u please help me.

thanks 

0
sancti
12/5/2008 10:23:22 AM

 Hi use supportfolder="foldername" in the html tag of the

 <cc1:freetextbox supportfolder="foldername"

Let you paste your HTML code and if possible the screenshot of the Solution explorer.. 

so we give the exact solution for the error...?


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 10:34:32 AM

hi,

I solved the error and the FreeTextBox is displaying correctly. But now the problem is i cannot put \n and space between the text.i.e i am writing FreeTextBox1 = "hello world\n"; But here it is not taking \n. What can i do for \n and space. Actually i am forming a complete table and left side part of the table initially inside the FreeTextBox. The right side of the table will come from database during runtime. Is it possible to make table and left side text of the table fixex initially. Can u please help me regarding this.

Thanks

0
sancti
12/5/2008 11:18:43 AM

 Hai there is no need to write html tags for line or break

 in the freetexbox you can draw table , anchor links, paste the images ,.. 

 for line just enter text on next line it will automatically insert the html tage in the database

 to save the text in the Freetextbox control. is

 Ex: String s     = freetextbox.Text; 

 


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 11:23:52 AM

hi,

I am not inserting text directly into the freetext box. For inserting a  text inside the freetext box i have written code inside the button_click event of .aspx.cs file. When i click the button it should insert the text. But the problem is it is inserting all the text but not considering any \n or space.  So how can i put \n and space to it. Otherwise the table should be ready inside the free text box before clicking the button.When i click the button it should produce the right side text from the database. I should not insert any text into the free text box during run time. Can u please help me regarding this.

Thanks

0
sancti
12/5/2008 11:39:40 AM

 I am not getting for wat purpose are you using this...

 shall i view your code , code behind......

 Freetextbox is used like a word, user can change font size style , color etc...


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 11:45:07 AM

hi venkatu,

    Actually i am generating a small student report. To generate the report i have written the code inside the button click. When the user click the button , it will generate the report. Previously i used text box for this. Text box can be able to produce the report but it cannot be able to change the font. Also i tried to take the print out of the contents of text box. But i didnt get that. I got the full web page print out. So i thought of using free text box. Now i can be able to take print out of the report , but the text is not inserting properly(it is not considering \n and space for ex : FreeTextBox1.Text = hello world\n; FreeTextBox1.Text = "hai\n"; This two lines should be printed in two different lines of the free text box). Just i want to know how can i insert \n and space inside the free text box. If this is not possible can u please tel me how  to print only content of text box.

0
sancti
12/5/2008 12:00:27 PM

 Are you assigning the text directly to freetextbox in Code

 dont do like that... just type in the freetextbox at runtime and click one ADD button

 then bind to datalist then print the report from the Datalist... I think you got my point..


Regards,
M.Venkatesan
My Blog : http://venkat-dotnetsamples.blogspot.com


Please remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
venkatu2005
12/5/2008 12:16:01 PM

hi venkatu,

  Since i am producing the report, i cannot able to put the text into the free text box during the runtime. Bcoz if the user want to see the report of the student means, he should press  only the button, and he should not insert any text. when he press the button the free text box should produce the report and he should be able to take the print out of it. This is what i need. Can u give me suggestion to do this.

thanks

0
sancti
12/5/2008 12:26:57 PM
Hello sancti,


Have you used the validateRequest='false' in the Page directive of the page where the HTML Editor is placed?

Make sure that this is in the form Page directive tag... !
ukr

Mark this as Answer if it helps you, As some other might get the solution quickly...!
0
ukr
12/5/2008 2:41:35 PM

hi ukr,

 I have already written that statement validateRequest = false. Now i cannot be able to load some text into freetext box since it is not considering space and \n. Can u please help me to solve this.

 thanks

0
sancti
12/8/2008 4:11:28 AM
Reply:

Similar Artilces:

Check if the text box "text" has changed (RePost from web forms forum)
Greetings! How can i know if the "text" inside of a text box has changed? For example, I currently have this: if (txtMU.TextChanged()) { } But this does not work. The other idea I had was to assign the existing value of the text box to a string and then when the user click the save button I can create a conditional statement to compare the original string with the new string. However, I would like something more effective as I have like 12 text boxes to compare. Thanks, EduardoThanks,Please Mark this post as answered if it was helpful. Here is the easiest way that I have ...

Load Text box of one web form with selected list item of list box of another web form
one help please Problem is i have two web forms  1.  ForiegnkeyTest.aspx  2. foroginkeytable.aspx   step 1 1 ForiegnkeyTest.aspx one web form <head runat="server"><script language="javascript" type="text/javascript">   function popWin()   {         var confirmWin = null;      confirmWin = window.open('foroginkeytable.aspx','anycontent',   'width=455,height=435,status');   }  </script> &...

Populate text box on a different web form
Hello All I have a button and a textbox on my Default aspx page, (Using VB),  when i click it i want to open my page customers.aspx and populate textbox1 with the details from the textbox on my default page, Can anyone point me in the right direction please thanks gibbo   You can use the session variables to save the textbox text of the Default page and retrieve it from the customers page // To Save the value of the textbox on the Default page use the below code Session("Textbox") = TextBox1.Text // To retrieve it from customers page and set it as the text ...

How to change Font Size on Text box dynamically
Hi, I m fresh in ASP.NET. and don't know how to do and from where to start working on. My first task is as follows: I want to have several Text boxes associated with a two way state of buttons. Each text box can have their associated two way state button. The left click of button associated with a particular text box decrease the current Font size of its associated text box and the right side of the button can increase the text box font size, it also shows the effect so that the text matter can be adjusted on real time to choose best font size for data printing. Remember the lable will...

changing the text on text box
hello, i need to build an addon which takes (on mouse click) the text of any given input text box and change it. how do i get theobject of the text box and set my text to its value. thanks... ...

Why would my text box background color be different for different text boxes without setting the background color
I have a form that has about a half dozen seperate text boxes. I have not set anything on these text boxes other than width sizes.  For some reason however when I build the page shows that some of the text boxes has a yellow background and some have a white background.  Any ideas what the problem could be.  You can see in the code below that no background color is set.  BTW this is VS2008..I do impose a theme on the page but the theme sets a back color of white...so in theory there shoudnt be any yellow backcoloered text boxes.   Theme code<asp:TextBox runa...

two different fonts in a single text box which displays the text dynamically
Hello, Is it possible to display a part of the text in bold and the remaining part in normal format in a text box which displays the text dynamically? Like when I click a button I want to concatenate the text entered in two text boxes and display them in a third text box but I want the first part of the text in bold and the text got from the textbox2 to be in normal format. Is it possible?   Thanks nope... not with a standard textbox. You'll have to use a Rich Text box, 3rd party/custom control.  Hello, See. Normal Consider Normal Text box as "notepad&qu...

Enabling button after text changed on text box from form view control
I'm using form view to display some text box that contains user's personal info. There are "save" buttons for each text box which are disable as default. I want to enable them when text is changed on the the text box. I don't know how to write the the JavaScript function to do this task and i also don't know how to call the function from the the textbox control (onchange or ontextchange?). Here is the formview code: <asp:FormView ID="FormView1" runat="server" DataSourceID ="personalSQL"> <ItemTemplate > <ta...

How do I block a user from entering text in a text box if they type text in another text box?
I have two text boxes, and want the user to complete one or the other.  How can I "grey out" one text box if a user starts typing in the other textbox?  Never make important decisions on a Monday! You can use the OnTextChanged event of the textboxes and write Javascript for both textboxes to disable the other textbox when the user starts to type in something in one textbox. The only problem with that is that once the user starts to type in something in one text box the other textbox gets disabled and locks up, so now the user HAS TO compulsarily type what he wants in th...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

Passing Text of a text box in child form to a label in parent form
Hi Elite People !! I have a parent form with a number of ASP Labels and Buttons. Each ASP Label has a ASP Button next to it. What I want to acheive is when you click the button, it should open a new window with a ASP multiline text box and a "save" button. User can enter the text in the text box and when they click the SAve button, the Text in the text box of the Child window should be displayed in the label on the parent form.  I am successfully able to do this when I have a Text Box in the Parent form, but my requirement is to use Labels on the Parent Form. I am ...

adjust text box size if text is too big to fit in its original size
 Hi,On mouseover of hypertext, I call function in javascript & print text in textbox. As shown following:<a  href=""  onclick="home() > </a> function home(){var TB=document.getElementById ("<%=txtbox.ClientID%>");TB.value="HELLO THERE "}  But if the text to be printed is too big to fit in text box, then text box size  (height, width)should get adjusted .Is there any property of textbox to achieve this?  Please Mark the post as "ANSWER" if it helps you Try with this:TB.style.width = &q...

Text style change on the text box
 Hi experts,I'm try to create an email system, i'm having problem on the compose new email which allow user to change their text style while they press the button, i had been totally out of idea to do it.So please give me any idea and suggestion how to do it... Thanks...Below is the basic of my code:<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="NewPost.aspx.cs" Inherits="_NewPost" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd...

Text box
I have a Popup calendar that opens when i click on the parent form and, and after selecting date - it fills the parent textbox and closes the popup window. Every thing is working fine, but i have one problem, i want the Textbox - textchanged event to fire when there is a change,(auto postback for textbox is set to true). This is not happening. If i manually type in the date in the textbox and go to other control then it fires, but not when i select date from PopUp. How to make it work Appreciate any response. Thanks. Parent Form JAVASCRIPT function OpenCalendar(...

Web resources about - how to change the font of some text in the text box to different size - asp.net.web-forms

Hillary Clinton’s national debt evasion
(Paul Mirengoff) At a political event in New Hampshire, someone asked Hillary Clinton to state with specificity what she would do as president ...

JJ Abrams pushes back on the rumors he cut Lupita Nyong’o's Star Wars role
There have been a lot of rumors floating around this week about Lupita Nyong’o’s role in Star Wars: The Force Awakens . We already knew she was ...

Beats Music subscribers have until Jan. 19 to make the switch to Apple Music
Now that Apple Music has arrived on Android as a public beta , Apple is finally shuttering its predecessor, Beats Music. But don’t worry: You’ll ...

More lousy weather as NASA tries for space station delivery
For the second day in a row, foul weather threatens to stall a critical space station delivery for NASA.

Stocks jump on solid jobs report; energy sector falls
NEW YORK (AP) — Stocks are climbing Friday morning after the U.S. government reported another month of strong job gains. The price of oil retreated ...

Facebook Testing Way for Hoi Polloi to Stream Live Video, Not Just Celebs
Facebook is making a bolder move into live video, saying it's testing a way for users to share live streams in the news feed. The company in ...

Pentagon chief to military: Open all combat jobs to women
WASHINGTON (AP) — Removing the final barriers that kept women from serving in combat, Defense Secretary Ash Carter has ordered the military to ...

Senate passes reconciliation
Washington Post Senate passes reconciliation Politico With help from Jennifer Haberkorn, Brianna Ehley and Sarah Karlin. ABOUT LAST NIGHT: ...

Friday Morning News Feed: Scott Weiland, Snow Lady, Vancouver, Virgin Galactic, Flesh + Fitness
DEATHS : Scott Weiland of the Stone Temple Pilots has died : “Weiland was on tour with his band Scott Weiland & The Wildabouts … they were supposed ...

Google’s picks for 2015’s best Android apps
Looking for a great new game or app to try on your Android phone or tablet? If so, you should check out Google's official list of 2015's best ...

Resources last updated: 12/4/2015 5:17:03 PM