Cropping form in VB.net - vb.net

I want to display a specific part of a webbrowser and I want to do that with an option to crop the form. Basically, when you resize a form it automatically affects the webbrowser, I want to somehow disable that and be able to crop the form. (winforms)

Related

VBA: Can't change Image Control picture after click on element

Setup
I have an Excel VBA UserForm with an Image Control element. When clicking on buttons in the form, the Image Control's Picture source is set / updated with the following code:
Set MyForm.imgControl.Picture = LoadPicture(pathToFile)
Problem
When the user clicks on the Image Control, updating its Picture source doesn't work anymore. The problem occurs, no matter when in the workflow the Image Control is clicked:
Example 1: User clicks a button to set the Picture (and pictures sets correctly). User clicks on Image Control. User clicks a different button to change the Picture -> displayed picture doesn't change.
Example 2: User clicks on Image Control right after Form load. User clicks on button to change the Picture -> displayed picture doesn't change.
If the user never clicks on the Image Control, everything works perfectly smoothly. It's worth noting that clicking on the Image Control doesn't visibly focus it.
Question
Clicking on the Image Control shouldn't make a difference in whether or not the Picture can be updated or not. How can this be done? Or, at least, does anyone know why the explained behavior is happening, or is it just a bug?
The Control does have Click / MouseDown / ... events (which are empty), but they don't take a Cancel parameter.
It does sound like a bug, as you say, but as a workaround, I'd suggest forcing a repaint after changing the picture:
Set MyForm.imgControl.Picture = LoadPicture(pathToFile)
MyForm.Repaint

PictureBox events not firing when it's embeded in a user control

VB PictureBox_mouseEnter() event not firing when the picture box is placed inside a custom control
I need to write code to do different things when a mouse enters and leaves a PictureBox (used to display images). When I place the PictureBox directly on a WindowsForm, the _mouseEnter() event works fine. But if I put the PictureBox on a custom control, and add the control to a WindowsForm, the _mouseEnter() event never fires. Why?
The reason I want to embed the PicturBox in a custom control is that I can reuse the custom control on other Windows Forms.
Thank you for your insights.

Scroll bars for Excel CustomTaskPane developed using VSTO

I have an add-in, developed using VSTO, that displays a custom task pane in Excel. This custom task pane holds a user control containing tree-view and other controls. I enabled AutoScroll for the user control and can see the traditional windows scroll bar when ever i re-size the control. However, i want the scroll bar to be similar to the scroll bars that exist in Thesaurus CTP in Excel 2013,when the CTP is in floating position and re-sized to smallest size, (i cant post images as i have reputation below 10). can any one provide pointers for this?
Also is there any way to restrict the minimum size of CustomTaskPane ?
Hello Guruteja,
You can handle the Resize event of the Control class to control the size of your form and set the min size programmatically.
It looks like you need to develop a custom control to imitate the built-in one. Or try searching for any third-party Windows Forms controls.

Transparent control or user control in vb.net

I am trying to make a transparent control with child controls that are visible and opaque.
I have added a panel control to the main form via code in the form load event. In this I am adding five buttons as child controls like: panel.controls.add(). To all of these, I have set backcolor=color.transparent.
When I run this program, the button background shows the background of the next button in the panel. If I open a child form, then I can see labels on the child form as the background of the panel.
I want to make container panel control completely transparent, so I can see the main form through it. How can this be achieved?
When the form loads, you can see neighbor buttons behind the actual buttons
"Perform Check" is a label on a child form which I opened right before taking this picture.
: "Check Cases and Combinations" is a button on a child form which I opened right before I took this picture.
How can I make it truly transparent? Why doesn't the background of the panel control refresh with the main form background? The panel sort of "keeps" whatever happens on the main form and shows it as a background.
I found out there some issues with setting controls that are transparent and on top of other controls in the main form. They take the background of the container form, whether or not there is any control in between. I used WPF form instead of the panel and it worked perfectly.

displaying play,pause buttons over picture box dynamically,in .net compact framework

I have two picture box to display some pictures at regular intervals in .net compact framework.
I need to show toolbar with play,pause buttons when i touch the respective picture boxes and hide when i touch the other one..
So what, exactly, is the question? You could use a third picturebox to hold your "toolbar" and display/hide it as necessary, or make the toolbar a user control so you can easily add in separate buttons.