I am developing chat app in C#,in which I have one richtextbox in which user enters text and "gif" emojis,although animation is not displayed in the richtextbox,but I require that animation to be displayed in to the webbrowser's div element.is there any method which can directly convert the "RTF" of the richtextbox which also includes images to the format which webbrowser's div can display?if yes than please provide me link.If no than please give me any idea regarding how can i achive this.I mean copy whole content of richtextbox to webbrowser's div,which will show animation for no animated images included in richtextbox..
I think what you are looking for is the contenteditable attribute of a div.
If you set the ContentEditable attribute you are able to write html directly to into your browser.
View this page to get more informations about the contenteditable attrbute.
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_Editable
or check this. maybe this is already what you want: http://jquer.in/helpful-jquery-plugins-for-html5-websites/emojiarea/
Related
I need to show html content like a textblock in Store App 8.1. I have created a webview and navigate this webview to the html string coming dynamically. After this I call a script to disable the scrolling in WebView but I am not able to set the height of WebView according to the amount of content coming dynamically. I have created another webview to get the height of content but it returns wrong height and sometimes text is not shown. So whole view is ruined.I need to show html content without scrolling. I tried RichtextBlock but it does not parse all html tags properly. Can somebody provide a solution to it?
After searching a lot All I could find was an alternative. It's not perfect but works ok. We can decode the string as html and use built in functionality to get string out of html text. It supports very less tags and most tag functionality like Bold and other tags are not visible yet better than removing all tags from code. Hope it helps someone else looking for answer.
I am displaying text in a rich textbox and i want it to show the html formatting on the text. Is there a way to make a rich textbox display html.
If you push the button on the following link you will see how my out put displays, i would like it done in a rich textbox.
http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html
Is there a way to build a rich textbox that can display html???
RTF encoding is different from HTML.
If not, then you need to write your own HTML to RTF converter or find something similar.
Writing Your Own RTF Converter. This guy gives a great breakdown of how the program works along with details of the conversion.
An Extended richtextbox control, Check this out. It may solve your solution
i have a word(Office) file. this file content text and picture.
how can read this file and show in <textarea> </textarea>;
The best way to display rich content like word document on UI is through html. You can export your word document to HTML and render it to asp.net UI controls. If you prefer, textarea, you have to implement custom textarea to support images from word-html file.
Also, you can use WebBrowser control to display this word-html file instead of textarea.
I don't believe you can read this into a <textarea> as you ask. (I will watch to see if somebody else shows how, because I want to see that too...) I believe the closest result you will get is to open the document into an <iframe> with the application/msword content type. If you are looking for some flexiblity in this, wrap the space in a <div> and swap out <textarea> for <iframe> at the server when appropriate.
I have an ASP.NET application designed for a Windows CE device that needs to take in information from a scanned barcode. The device sends the scanned data as string input with a crlf to whatever field has focus. I set up my page with a textbox that takes the input and posts back to look up the item.
Now, I'd like that box to not be visible to the user, but IE complains when I set focus to it if the field is "visibility: hidden" or "display: none". I've tried moving it off screen using absolute coordinates, but setting the focus scrolls the window to the new location.
Does anyone have any suggestions to work around this problem? Thanks in advance.
I sometimes hide items by
.hide{margin-left:-99999px; position:absolute;}
with css, pushing the element off-screen but leaves it's visibility in the DOM and position intact;
Try using the visibility:hidden on a div around the input field.
Can you scan the value to a hidden field?
If u don't want to show this textbox to user then use hidden field.
Does anyone have any ideas how to create a function that resizes text on a page dynamically without the use of JavaScript? I'm using CMS based on C#?
Is it possible with CSS only? if it's not possible then i want to do with javascript like this page http://demo.joomla.org/1.5/?template=beez and as a fallback want to user server side solution which this page hasn't http://demo.joomla.org/1.5/?template=beez
Without javascript? Well, guess you will have to perform a postback onchange, then perform resize in your codebeind. Not very user friendly though.
I doubt CSS can do that.
You could create 3 links:
A A A
Then on postback, use the value of the 'size' query string attribute as a CSS font-size value. something like (pseudocode)
// aspx
<div style="font-size:<%= getsize(); %>"> ...
// code behind
getsize(){
return Request.QueryString["size"];
}
If you are getting size from database then you can do one thing:
Create a panel and put all controls in it and set size dynamically.
See following for more details:
http://asp-net-example.blogspot.com/2009/04/how-to-set-change-panel-font-size.html
I think you are misunderstanding something, you want a C# function for something that is fundamentally client side? Do you want to do it after the page has loaded or before? You can resize text on a page with CSS easily.
body{ font-size:60%; }
If you are looking for say 3 sizes (standard, large, huge) then the way I've done this is to create the visual elements as ImageButtons or CSS'ed Buttons to style them to fit the design.
You can then hold the body{font-size:1em;} outside of the CSS includes (but before it in the head section) within a Literal to honor the browser defaults by default. When the postback occurs you can adjust the literal accordingly - e.g. large would be adjusted to body{font-size:1.5em}.
litFontSize.Text = "body{font-size:1.5em;}"
You do need to check that the body font-size is being inhereted throughout though, cross browser - form text for one will need independent definiton in my experience.
What do you want to trigger the dynamic-resizing? The window being resized? Or the user pressing a button?
If you want to resize text when a user resizes the window, then no - you won't be able to do that with CSS alone, since CSS doesn't have any way of setting font sizes based on the window size. Every site I've seen that does this does it via javascript.
If you want the trigger to be a button press, then this is pretty simple - the button sends a postback to the server, you pick up their desired size from a dropdown or from the specific button that was pressed, and then you can add some CSS into the page or add a link to a different stylesheet.