How to capture popup webpage in tabcontrol browser - vb.net

How to capture the popup when clicked when the button is clicked in webbrowser it opens a popup webpage i need to capture the popup webpage to the tabcontrolbrowser

I think I understand what you are trying ask for. I have had a similar issue where I must display a form nested within another form. To do so I have used code similar to this:
aForm = New TLoginForm
aForm.TopLevel = False
pnlLoginPanel.Controls.Add(aForm)
If aForm.WindowState <> FormWindowState.Maximized Then
aForm.WindowState = FormWindowState.Maximized
End If
aForm.Show()
I like using a panel control to contain the form I am instantiating. It is just easier for me to understand the bounds of the form when it is getting displayed and it is easier to use a panel control's Controls.Add ability than a tab-page's alone. When I am using a log-in form or another type of form nested within another form I create a panel control to 'hold' the form inside and provide bounds for it to be displayed in. Then the TopLevel property of the log-in form must be set to False so that the form I am displaying knows it will not be displayed on its own as a top level window. Be sure to do this as an error can be encountered otherwise. The WindowState.Maximized is to ensure that the form fills the panel.

Related

Endless form not showing after filter applied previously

I am using unbound endless forms to display data from my database.
The data source is set to queries which provide data to show on the form.
All tinkering with the data itself on the form is blocked (entry, adding, deleting, etc.).
The data on the form can, however, be filtered through Access' standard ways (right clicking on the data and selecting the options or through the navigation buttons down the bottom of the form).
I am using another unbound form as a menu. Buttons on the form let the user open the data display forms. The buttons are connected to the forms through an on- click event that triggers a DoCmd.OpenForm ("frmOutput") line of code to display the form.
Recently I've had users report, that opening the endless data display forms from the menu, filtering data on the form and then closing the form without taking the filter out has resulted in the form not being able to be opened again from the menu (clicking the respective button results in no action whatsoever). The bug seems to even save to the application somehow and moving the (frontend) file to another machine still shows the same error of not showing the form.
It seems that the bug appears more often when people use multiple screens, and use the application on their second screen (as per their Windows settings).
Does anybody know what causes the bug or how it can be prevented?
Any pointer in the right direction is much appreciated since I am at a loss where to even start looking for the culprit!
Hard to tell but it sounds like their filter is being saved when form is closed
If you already have an event that opens the form, try to just clear the filter property after it opens. You can do this from all your command buttons by just changing the form name that gets passed to it
Private Sub OpenUnfilteredForm(strFormName as String)
Dim frm As Form
DoCmd.OpenForm (strFormName)
DoEvents
If CurrentProject.AllForms(strFormName).IsLoaded Then
Set frm = Forms(strFormName)
With frm
.Filter = ""
.FilterOn = False
End With
End If
Set frm = Nothing
End Sub

Loading new form within a navigation tab in ms Access 2010

I have created the following navigation structure in a Microsoft access 2010 database:
You can see that there are two tabs, and the data for the tabs is populated with information linked to the ClientID, which is stored in an un-editable textbox at the top of the form. When the Communications Forms tab is selected, a list of communications forms that have been completed for the specific ClientID is shown. And there is a button to create a new form. My question is how do I write the macro so that clicking on the Create New Form button will cause a blank new form to be loaded in the space that is currently occupied by the List of Forms?
Below is what I have so far. It sends the user to a new form instead of embedding the new form underneath the Communication Forms tab in the current form. How can I change the below so that the blank new form is loaded under the Communication Forms tab in the current form, so that all the navigation controls remain visible/usable?
EDIT:
To address HK1's assumptions below, I am adding the following description of the steps I took to create the form in the screenshot above:
1.) I created a blank form in design view.
2.) I added a listbox to list client fullname and id, and a textbox to filter the listbox.
3.) I added the clientid and fullname textboxes to the form, and set them to change based on
what the user selects from the listbox
4.) I dragged a navigation control onto the form next to the listbox
5.) I dragged a form called "ListOfForms" onto a new tab in the navigation control to create the tab
6.) I added the CreateNewForm command button to the ListOfForms form while embedded in the main form
Here is the result of HK1's suggested code:
While I appreciate it, it does not do what I need. You can see that it just adds an additional row to the list in ListOfForms. Instead, I need the code to place a blank MyForm in the place of MainForm where ListOfForms is currently located. Thus, under the CommunicationsForms tab, all the user would see would be a blank MyForm object, which is a different form than ListOfForms.
When I click on the place where ListOfForms is located in Layout View, I see that it is called NavigationSubForm in the Property Sheet. Thus, NavigationSubForm would swap in MyForm in place of ListOfForms when the user clicks on the Create New Form command button. But if the user clicks on CommunicationForms tab again, ListOfForms would again be placed in NavigationSubForm.
I tried the following:
Private Sub cmdCreateNewForm_Click()
Forms!MainForm!NavigationSubform = MyForm
End Sub
But it generates a Runtime Error '438': Object doesn't support this property or method.
Next, I tried:
Private Sub cmdCreateNewForm_Click()
Forms!MainForm.NavigationSubform.SourceObject = MyForm
End Sub
This causes the NavigationSubForm to go blank, so that ListOfForms disappears. This seems like I am on the correct track, but what do I need to do to get it to put a blank MyForm in the NavigationSubForm instead of just an empty space?
The form you have labeled as "List of Forms" appears to be what's called a continuous form, and I'm guessing it's inside a subform control located on a another form. I'm also guessing that your Create New Form button is probably located on the header section of your continuous form. I'm also making the assumption that your continuous form/subform is bound to an editable recordset/recordsource but there's no way I can tell this by looking at the screenshot.
With these assumptions in place, the code for your Create New Form button would probably be something like this:
Private Sub cmdCreateNewForm_Click()
Me.AllowAdditions = True
DoCmd.GoToRecord, , acNewRec
End Sub
If any of my assumptions above are incorrect than it's likely this code won't work as expected.
Be aware that New Records in continuous forms (and datasheet forms) always appear at the bottom of the list. I'm not aware of any easy way of making them appear anywhere else.

Form maximize on another form

I have an MDI application which contains many child forms
My problem is, on clicking a particular menu, I am opening a form with maximize window in the MDI form. This works fine.
Now if I open another form above the first one, and if i want the second form to be of normal size, i am unable to do it.
Second form also opens with maximized window similar to first one. I want the second form to be of normal small size.
I want to show second form normally and first form maximized.
How can i do that?
Private Sub TESTToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TESTToolStripMenuItem.Click
Dim f As New newCalendar2("UGHARANI")
f.Show()
f.MdiParent = Me
f.WindowState = FormWindowState.Maximized
End Sub
Okay, I think I understand what you're trying to accomplish: you want the first (data) form to be a kind of background to your MDI application and have the other forms display on top of it, right?
Well one way to do it might be to remove borders from the background form –FormBorderStyle = None– and fill-dock it in the MDI parent form. Although it would end up coming to the fore and hiding all your other forms if a user clicked anywhere on it. But if it doesn't require any user interaction you could always use its Activate event to send it back to the background, using Me.SendToBack().

Form not brought to front when dragged

I have created a list form that gets attached to a main form in VB.NET. This all works fine except that when the main form gets activated, I need the list to be brought to the front as well. I have put in a simple IF function to do this but when I added these lines of code, the main form, as well as the list form now do not get brought to the front until you let go of the mouse button. Obviously this means that if you drag the form, it stays at the back until you let go of the mouse button.
The code that I added is below:
If CRL.Visible = True Then
CRL.BringToFront()
End If
CRL is the list form.
If I comment out this code again, the main form get brought to the front while dragging but obviously the list form does not. The main form as well as the list form are MDI children.
You trick it by topmost property:
If CRL.Visible = True Then
CRL.BringToFront()
CRL.TopMost = True
Application.DoEvents
CRL.TopMost = False
End If

Loading user control dynamically loses data

I have a created a user control. This user control I dynamically load on a page inside Telerik Panelbar control. I have done all necessary coding to save the viewstate and load this dynamically created usercontrol every time page loads.
On this User control I have a asp panel. By default this panel is invisible. When user clicks a button on this user control panel is made visible. On page load of this user control I populate all the controls on this panel.
Everything works fine if I don’t load this use control dynamically but when I load this user control dynamically and if I make panel visible by default then only all fields on the panel are populated. But if I make by default invisible and on button click make panel visible none of the text boxes or comboboxes are populated.
I populate comboboxes on page load of the userControl but inbetween postbacks all the comboboxes on the user control loose data.
ON the parent page I am saving the viewstate
This is my code on parent page to dynamically load userControl ( which has panel on it)
Dim ucPiggyBank As SubscriberSetupPages_UserControls_PiggyBank = CType(LoadControl("~/SubscriberSetupPages/UserControls/PiggyBank.ascx"), SubscriberSetupPages_UserControls_PiggyBank)
With ucPiggyBank
.PiggyBankID = account.Id
.ID = account.Id.ToString
'Setting up following 3 properties here to avoid database trips
.PiggyBankEligibleAccounts = piggyBankEligibleAccountCollection
.MemorizedNames = memorizednames
.Period = period
End With
radPanelNewChild.Controls.Add(ucPiggyBank)
radPanelNew.Items.Add(radPanelNewChild)
radPanelNew.Expanded = True
‘this is the Panel item on parent page of Telerik Panelbar control.
Dim radPanelPiggyBank As RadPanelItem = DirectCast(pnlbarPiggyBank.FindItemByValue("TestItem"), RadPanelItem)
With radPanelPiggyBank
.Items.Add(radPanelNew)
.DataBind()
End With
‘I am doing everything for saving viewstate on parent control
This is the code on page load of userControl
If Not IsPostBack Then
If m_PiggyBankID <> Guid.Empty Then
'Load data
Call GetPiggyBankDetails()
End If
I have a edit button on the user control which makes panel visible. It makes panel visible but with no data.
Can you please tell me what’s happening?
Thanks in advance.
If data is posted, you can get it from Request.Form[control.UniqueID] , but don't use viewstate possibilities hehe if control added dynamically.