473,378 Members | 1,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Using axwebbrowser control and thread locking app

When i try to run the program, it just hangs. If i remove the axwebbrowser control it works fine.

Any ideas?

Here is my code:

class1.vb
Expand|Select|Wrap|Line Numbers
  1. Imports System.Windows.Forms
  2. Imports System.Threading
  3.  
  4. Public Class Class1
  5.   Public Shared form1 As New Form1
  6.  
  7.   Shared Sub Main(ByVal Args() As String)
  8.     Dim t2 As Thread
  9.  
  10.     t2 = New Thread(AddressOf screen)
  11.     t2.Start()
  12.  
  13.   End Sub
  14.   Shared Sub screen()
  15.  
  16.     form1.ShowDialog()
  17.   End Sub
  18. End Class
  19.  
Form
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Windows Form Designer generated code "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'This call is required by the Windows Form Designer.
  10.         InitializeComponent()
  11.  
  12.         'Add any initialization after the InitializeComponent() call
  13.  
  14.     End Sub
  15.  
  16.     'Form overrides dispose to clean up the component list.
  17.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  18.         If disposing Then
  19.             If Not (components Is Nothing) Then
  20.                 components.Dispose()
  21.             End If
  22.         End If
  23.         MyBase.Dispose(disposing)
  24.     End Sub
  25.  
  26.     'Required by the Windows Form Designer
  27.     Private components As System.ComponentModel.IContainer
  28.  
  29.     'NOTE: The following procedure is required by the Windows Form Designer
  30.     'It can be modified using the Windows Form Designer.  
  31.     'Do not modify it using the code editor.
  32.   Friend WithEvents AxWebBrowser1 As AxSHDocVw.AxWebBrowser
  33.   Friend WithEvents Button1 As System.Windows.Forms.Button
  34.   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  35.     Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  36.     Me.AxWebBrowser1 = New AxSHDocVw.AxWebBrowser
  37.     Me.Button1 = New System.Windows.Forms.Button
  38.     CType(Me.AxWebBrowser1, System.ComponentModel.ISupportInitialize).BeginInit()
  39.     Me.SuspendLayout()
  40.     '
  41.     'AxWebBrowser1
  42.     '
  43.     Me.AxWebBrowser1.Enabled = True
  44.     Me.AxWebBrowser1.Location = New System.Drawing.Point(48, 24)
  45.     Me.AxWebBrowser1.OcxState = CType(resources.GetObject("AxWebBrowser1.OcxState"), System.Windows.Forms.AxHost.State)
  46.     Me.AxWebBrowser1.Size = New System.Drawing.Size(300, 150)
  47.     Me.AxWebBrowser1.TabIndex = 0
  48.     '
  49.     'Button1
  50.     '
  51.     Me.Button1.Location = New System.Drawing.Point(440, 72)
  52.     Me.Button1.Name = "Button1"
  53.     Me.Button1.TabIndex = 1
  54.     Me.Button1.Text = "Button1"
  55.     '
  56.     'Form1
  57.     '
  58.     Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  59.     Me.ClientSize = New System.Drawing.Size(584, 272)
  60.     Me.Controls.Add(Me.Button1)
  61.     Me.Controls.Add(Me.AxWebBrowser1)
  62.     Me.Name = "Form1"
  63.     Me.Text = "Form1"
  64.     CType(Me.AxWebBrowser1, System.ComponentModel.ISupportInitialize).EndInit()
  65.     Me.ResumeLayout(False)
  66.  
  67.   End Sub
  68.  
  69. #End Region
  70.  
  71.   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  72.     'Me.AxWebBrowser1.Navigate("http://www.ibm.com")
  73.   End Sub
  74. End Class
Oct 9 '08 #1
1 1336
debasisdas
8,127 Expert 4TB
question moved to .net forum
Oct 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Lecture Snoddddgrass | last post by:
Hi, I noticed that my WinForms app was taking a while to start up. I stepped through the code to find out which line was causing the delay. The delay is occurring within one of my UserControls...
11
by: Doug Thews | last post by:
I've been working on some samples that use BeginInvoke/EndInvoke. In one example, I call BeginInvoke and pass it an AsyncCallback function pointer. I was messing around with ReaderWriterLocks and...
2
by: Andy Heitke | last post by:
My problem is similar to the thread entited, "SP2 kills my AxWebBrowser" except that I haven't been able to get the fixes to work for me. I've written an application that uses an embedded...
1
by: Mantorok | last post by:
Hi Is there anyway to get a WebBrowser to work without placing it on a form. I want to be able to instantiate a browser, complete some of the fields and submit, but whenever I try to navigate...
0
by: beau | last post by:
Hi, I'm using the AxWebBrowser in a C# WinForms application. I've got the basics working, but need some help controlling the view options for browsing files. How can I disable the...
1
by: MPR | last post by:
I'm displaying a web page with the navigate2 method of the axWebBrowser control. On the web page that is already in the axWebBrowser control, there are severla links, like in any other web page....
13
by: Udhay | last post by:
I am trying to use the AxWebbrowser control in my VB.Net application. The control is placed on one of the tab pages in the form. This is the error I am getting when I have the 'exceptions' set to...
6
by: Dave Booker | last post by:
It appears that I cannot correctly install the AxWebBrowser in VS2005. I can instantiate an "AxWebBrowser browser" and refer to its members, properties, and methods. I'm having trouble with the...
6
by: Gina_Marano | last post by:
Hey All, I am using multiple child threads per main thread to download files. It sometimes appears as if the same file is being downloaded twice. I am using "lock". Am I using it correctly? Any...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.