views:

97

answers:

3

Hi

I am wondering does anyone know if it is possible to render html in a mobile 6 form? The only way I can think that may work is the internal web browser control.

I am wondering is there a better way? I am thinking if I go the path of web browser control I will have to generate an html file then insert the code I want into this file.

I need something like this because I am pulling in some text that can possibly be formatted with html stuff such as font weight.

+3  A: 

A Browser Control is really the only way (unless you want to parse the HTML yourself and turn it into rich text for an RTF control, or worse, manually handle it all yourself).

ctacke
Hmm how could I do this parsing any 3rd party things that can do this? Since I use the browser control to display my html stuff but they have a choice to edit it. I would not know how to make a textbox in a browser control then have the rest of my controls in a form application and try to get that textbxo from the browser control and merge with all the other controls.
chobo2
So you want an *editable* HTML control? Why not do what SO itself does? Have a standard TextBox for editing and a browser control for the preview.
ctacke
Because if the the text they are calling up has html and you stick it in a regular textbox they will just see tags like <b>important</b> instead of actually seeing it bold.
chobo2
So you will see it bold when viewing it but the second you try to edit it you will get what I had above.
chobo2
Yes, you need *2* controls for this. Just like everyone else uses.
ctacke
I don't mind having 2 controls if it solves my problem. What I don't think it will. I have 2 controls basicly just on different forms. One is a browser control that renders html. However this does not help the user if they wish to edit the text. If they edit the text they will see the actual html tags. Not ever person using my application is going to know html. So I was trying to find something that is like a rich textbox that would hide the html tags and render it as they would be.
chobo2
A: 

As people have said you do need 2 controls, but it might be possible to hide the regular textbox (maybe behind the browser control) will still leaving it editable.

In this case although it would be controlled underneath with code like <b>mytext</b>, the user would never see that giving them some illusion of a WYSIWYG editor (though I can already imagine a few problems you might come into attempting this)

Joseph Earl
A: 

I have written an HTML edit control for .NET.

It doesn't currently support Windows Mobile: but I have Windows Mobile development experience myself, and I might be able to port it to the Compact Framework, if you would be willing to pay for that, as explained in the Developing New Functionality section.

ChrisW