Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do i programatically restart the current website or appdomain Pin
Heath Stewart8-Jun-04 17:38
protectorHeath Stewart8-Jun-04 17:38 
GeneralHelp with Windows services Pin
quilkin8-Jun-04 11:58
quilkin8-Jun-04 11:58 
GeneralRe: Help with Windows services Pin
Heath Stewart8-Jun-04 12:21
protectorHeath Stewart8-Jun-04 12:21 
GeneralRe: Help with Windows services Pin
quilkin9-Jun-04 2:20
quilkin9-Jun-04 2:20 
GeneralRe: Help with Windows services Pin
quilkin9-Jun-04 5:49
quilkin9-Jun-04 5:49 
GeneralListbox not refreshing. Pin
shadow_nubcake8-Jun-04 11:28
shadow_nubcake8-Jun-04 11:28 
Generalevent not picked up by form Pin
RomanD8-Jun-04 10:16
RomanD8-Jun-04 10:16 
GeneralRe: event not picked up by form Pin
Heath Stewart8-Jun-04 11:35
protectorHeath Stewart8-Jun-04 11:35 
The WebBrowser control is an ActiveX control and dispatches messages in its own thread, i.e. .NET will not respond to notification messages for that ActiveX control. If you set the focus back to the Form by clicking in a TextBox or a Button or something, then it actually has the focus and will process the key down and up messages.

To combat this, set Form.KeyPreview to true. This will handle certain notification messages (which the .NET FCL assemblies translate to events) before the control with the focus. This will still not help when the WebBrowser control has the focus.

As far as your last question goes, this really isn't possible. The width of a page or an image displayed in the WebBrowser control doesn't set the size of the WebBrowser control. Rather, the WebBrowser control sets the size.

Now, script in the page can set the size of the WebBrowser control (depending on security settings). You can declare the IDocHostUIHandler and override the ResizeBorder in order for your Form (the hosting control) to resize itself if script resizes the Window. See the article Using MSHTML Advanced Hosting Interfaces[^] for more details on this.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: event not picked up by form Pin
RomanD8-Jun-04 12:09
RomanD8-Jun-04 12:09 
QuestionHow do I lock and Unlock files Pin
silverbullet8-Jun-04 8:32
silverbullet8-Jun-04 8:32 
AnswerRe: How do I lock and Unlock files Pin
Heath Stewart8-Jun-04 8:43
protectorHeath Stewart8-Jun-04 8:43 
GeneralTreeView context Menu C# Windows Forms Pin
OMalleyW8-Jun-04 8:27
OMalleyW8-Jun-04 8:27 
GeneralRe: TreeView context Menu C# Windows Forms Pin
bneacetp8-Jun-04 15:42
bneacetp8-Jun-04 15:42 
GeneralListView Scrollbars disappear Pin
Guinness4Strength8-Jun-04 7:59
Guinness4Strength8-Jun-04 7:59 
GeneralRe: ListView Scrollbars disappear Pin
Guinness4Strength8-Jun-04 10:35
Guinness4Strength8-Jun-04 10:35 
GeneralRe: ListView Scrollbars disappear Pin
Heath Stewart8-Jun-04 11:29
protectorHeath Stewart8-Jun-04 11:29 
GeneralRe: ListView Scrollbars disappear Pin
Guinness4Strength9-Jun-04 5:03
Guinness4Strength9-Jun-04 5:03 
GeneralLooping through all controls on a webform Pin
caheo8-Jun-04 7:29
caheo8-Jun-04 7:29 
GeneralRe: Looping through all controls on a webform Pin
Colin Angus Mackay8-Jun-04 7:50
Colin Angus Mackay8-Jun-04 7:50 
GeneralRe: Looping through all controls on a webform Pin
caheo8-Jun-04 8:12
caheo8-Jun-04 8:12 
GeneralRe: Looping through all controls on a webform Pin
Colin Angus Mackay8-Jun-04 8:22
Colin Angus Mackay8-Jun-04 8:22 
GeneralRe: Looping through all controls on a webform Pin
Heath Stewart8-Jun-04 8:41
protectorHeath Stewart8-Jun-04 8:41 
GeneralRe: Looping through all controls on a webform Pin
Dave Kreskowiak8-Jun-04 7:56
mveDave Kreskowiak8-Jun-04 7:56 
GeneralRe: Looping through all controls on a webform Pin
Heath Stewart8-Jun-04 8:18
protectorHeath Stewart8-Jun-04 8:18 
GeneralRe: Looping through all controls on a webform Pin
Dave Kreskowiak8-Jun-04 8:47
mveDave Kreskowiak8-Jun-04 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.