Tabcontrol in VB.NET - vb.net

Using VB.NET in Visual Studio 2005, how do you disable or make read only a particular tabpage?

The only way I can see, for now, is using the TabControl.Selecting control event and manage everything by code.
Just turn e.Cancel to true to block access to a specific tabpage.

Related

Using forms in main form's panel with any size in Visual Studio

I'm working on VB.NET tool. Attached there's a basic scheme of my question. I'd like to use secondary windows forms in my primary(main) form's defined panel area. Secondary forms will contain toolstrip and menustrip also i would like to use them in my main form with best responsive way.
Do you suggest any elements to use for second form or first form like (flowlayoutpanel, toolstripcontainer, etc.)
For adding the other forms in my first form's panel area there should be a code like that but i don't very well because it didn't worked on me.
Dim f As New Forms
f.TopLevel = False
f.WindowState = FormWindowState.Maximized
f.FormBorderStyle = Windows.Forms.FormBorderStyle.None
pnlMainPanel.Controls.Add(f)
End Sub
Note: I'm using Visual Studio 2012, .NET Framework 4.5.2 OS: Windows:7, VB.NET

Is there any intelligent way of handling VS event handler removal after copy/past of control

I am using VB.Net 2008 and have been experiencing event handler removal after I do copy/paste of controls, such as to group box or panels. I had to add event handles manually for every control. When I try to move them instead of copy/paste, I had to deal with the z-order of each control. That is also a manual work. And this all becomes time consuming when there are several of them.
My questions are:
1) Is this a problem only for VS 2008 or for all VS?
2) Is there any other intelligent way of handling this issue?
Unfortunately, that's the way it is up through VS2013 at least.
If this is a recurring problem with a certain set of controls, you can create a user control containing them and put most of the offending handlers inside the user control.

Visual Basic : How to Block all message boxes, popups and alert dialog

I am making a webbrowser using VB 2010, and I often see popups regarding script errors or advertisement when browsing. I want to disable all message boxes and script error boxes too. I do not want to stop or block scripts from running, I want browser to continue running them but not to show the popup alerts.
WebBrowser1.silent = True isn't working
Thanks in advance
You have tagged this as VB.NET, which I believe is incorrect. In .NET you would use webBrowser.ScriptErrorsSuppressed = true as shown here: Disable JavaScript error in WebBrowser control
The Silent property is available on the ActiveX web browser control in VB6 and probably VBA (?). I believe there is a problem with setting Silent to true there, because it gets set back to false at run time whenever the control is loaded. There is an example on how to work around that by using a timer control, which is available here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=43907&lngWId=1

Instantaneous event for DevExpress.XtraBars.BarEditItem check changed

I am currently using DevExpress 11.2 within Visual Studio 2010. Currently I am using two DevExpress.XtraBars.BarEditItem which gives me two check boxes (with a label) in my menu bar (DevExpress.XtraBars.Bar) at the top of my windows form. Right now I have working code so that when one checkbox is clicked it unchecks/checks the other checkbox and executes code specific to that box. This works.
My problem is that the DevExpress.XtraBars.BarEditItem does not have a check changed event. Currently I am using the EditValueChanged event as the checked check box is set to True and the unchecked checkbox is set to false. However the EditValueChanged event isn't called until the checkbox looses focus. This doesn't work for me as I want it instantaneous. I looked into the itemClick and ItemPress events but they don't give me the new editvalue and if someone presses on the caption (rather than the box portion) it still fires. Is there someway to get the event right away??
I am looking in two different older projects (both in Visual Studio 2008 and using DevExpress 9.2 and 10.2) and it looks like it does everything the same way as me yet the EditValueChanged event fires right away without any lose of focus.
Actually what you want to do is use the events on the repositoryCheckEdit that is in the BarItem, rather than the barEditItems events directly. It will have CheckChanged and CheckStateChanged Events that you can use.
The repository Item that you want to use for the events will be listed in the Edit property of the BarEditItem.
In Code:
Dim item As New DevExpress.XtraBars.BarEditItem
Dim Editor As New DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit
item.Edit = Editor
AddHandler Editor.CheckedChanged, AddressOf RepositoryItemCheckEdit1_CheckedChanged

How to tell when the DevExpress FindPanel is closed?

I am currently programming in Visual Studio 2010 within VB.NET and am using DevExpress v10.2.
I just started programming with the WinForms XtraGrid FindPanel and so far it works wonders. However I was wondering if there is any way to know when the user closes the FindPanel. Right now if gridview.OptionsFind.AllowFindPanel is True and gridview.OptionsFind.AlwaysVisible is False then the user is able to click on the x and close the FindPanel. Is there anyway to catch this closing? I don't want to stop it just do a couple of things once it is hidden or closed.
Thanks
Apparently DevExpress Gridcontrol doesn't have a separate event for whether the FindPanel is hidden or shown. Instead I used the GridView's Layout event and inside checked if the FindPanel was visible or not with: gridView.IsFindPanelVisible