|
-
August 27th, 2011, 07:40 AM
#2
Re: Component WebBrowser or script on form
I watched the example in msdn, it good work, but for my html I have some errors, maby visual studio fink about html code as c++ code, this is my sorce:
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
this->webBrowser2->DocumentText="<!DOCTYPE html>"+
"<html>"+
"<head>"+
"<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>"+
"<style type="text/css">"+
"html { height: 100% }"+
"body { height: 100%; margin: 0; padding: 0 }"+
"#map_canvas { height: 100% }"+
"</style>"+
"<script type="text/javascript""+
"src="http://maps.googleapis.com/maps/api/js?sensor=true">"+
"</script>"+
"<script type="text/javascript">"+
"function initialize() {"+
"var latlng = new google.maps.LatLng(-34.397, 150.644);"+
"var myOptions = {"+
"zoom: 8,"+
"center: latlng,"+
"mapTypeId: google.maps.MapTypeId.ROADMAP"+
"};"+
"var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);"+
"}"+
"</script>"+
"</head>"+
"<body onload="initialize()">"+
"<div id="map_canvas" style="width:100%; height:100%"></div>"+
"</body>"+
"</html>";
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|