0

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.

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
chobo2
  • 83,322
  • 195
  • 530
  • 832

3 Answers3

3

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
  • 66,480
  • 18
  • 94
  • 155
  • 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 Dec 13 '09 at 19:48
  • 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 Dec 13 '09 at 20:02
  • 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 important instead of actually seeing it bold. – chobo2 Dec 13 '09 at 20:15
  • 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 Dec 13 '09 at 20:16
  • Yes, you need *2* controls for this. Just like everyone else uses. – ctacke Dec 19 '09 at 16:32
  • 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 Dec 19 '09 at 20:14
0

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
  • 215
  • 2
  • 2
0

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
  • 54,973
  • 13
  • 116
  • 224