public Form1() { InitializeComponent(); letalisce = new Letalisce(); button3.Enabled = false; width = Math.Max(groupBox3.Width, groupBox3.Width); height = Math.Max(groupBox3.Height, groupBox3.Height); // Resize the control to the exact size to display the page. Also, make sure scroll bars are disabled webBrowser1.Width = width; webBrowser1.Height = height; }
private void button1_Click(object sender, EventArgs e) { localhost.WebService services = new localhost.WebService(); try { if (listView1.SelectedItems != null) { XmlSerializer deserializer = new XmlSerializer(typeof(Letalisce)); using (StringReader reader = new StringReader(services.GetLetalisceByCode(listView1.SelectedItems[0].Text))) { letalisce = (Letalisce)deserializer.Deserialize(reader); } } webBrowser1.DocumentText = @"<html> <body> <iframe src=" + letalisce.Map + " style='Height:" + height + "; Width:" + width + "'></iframe></body></html>"; webBrowser1.ScriptErrorsSuppressed = true; textBox2.Text = letalisce.Opis; } catch { MessageBox.Show("Izberi letališče!"); } }