I want to load a form on to a Tab control page during runtime. plz help me out
4 18142
Hi!
Assuming you have two forms:
1) MainForm - form that contains the tabcontrol (assuming it has 2 pages)
2) UserForm - form to be added into the MainForm's tabcontrol page.
There are two solutions:
# 1 Solution: In the load event of MainForm write this code...
Private Sub MainForm_Load(B yVal sender As Object, ByVal e As System.EventArg s) Handles MyBase.Load
Dim frmUser As New UserForm
frmUser.TopLeve l = False
frmUser.FormBor derStyle = System.Windows. Forms.FormBorde rStyle.FixedSin gle
Me.TabControl1. TabPages(0).Con trols.Add(frmUs er)
frmUser.Show()
End Sub
Note: you may change the borderstyle to suit your preferences. You may set it to "NONE" so that the controls in UserForm will appear like part of the tab page control and not the Form itself.
# 2 Solution
Create UserForm as a "user control" and not a "form" then rebuild. Once it is found in the object list in the Object Explorer, you can drag the object towards the tabpage on your MainForm.
Hope this helps.
vbie
oh btw, i was recommending that solution for vb.net
Thanks so much for your informative answer. Your first option worked like a champ. Keep up the great work.
BTW, I modified your solution for C#, but it was very straightforward .
Thanks again.
Regards,
Darwin
Camas Imaging Group
Thanks so much for your informative answer. Your first option worked like a champ. Keep up the great work.
BTW, I modified your solution for C#, but it was very straightforward .
Thanks again.
Regards,
Darwin
Camas Imaging Group
Thank you too. I'm glad to be of help.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John Kirksey |
last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter the results in the grid.
Say you filter the grid for records that have a certain condition set to "NO" (in this case a checkbox). In this scenario the search returns one result. If I then check the checkbox ("YES") and save it, I now get my message...
|
by: Frank 'Olorin' Rizzi |
last post by:
Hello everyone.
This is quite convoluted, but I'll try to make it simple.
I have a couple of bottom-line questions (I guess):
1~ what happens between the Page_Load routine in the code behind of an aspx
page and the
presentation of the page to the user?
2~ is it true that the engine takes data from the Request.Form and puts them
|
by: Invalidlastname |
last post by:
Hi,
We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
|
by: John Alesse |
last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form
It takes IE 12 seconds to load this control into the page. CPU usage is at only 1% to 2% during the 12 sec
All of this is on a single machine
XP Pro sp1 (all critical updates loaded)
2.6GHz, P4, 512MB ra
IE v6.0.2800.1106.xpsp2.030422-1633
IIS 5.1
..net...
|
by: Sam |
last post by:
I have a custom control (MyTextBox - taken from Microsoft website)
that implements the IPostBackDataHandler interface. It is added to
the controls collection of a placeholder control during the Page Load
of a main ASPX page. Now if we debug the MyTextBox, we find the order
of events like so (during a Posback, of course): OnInit -> OnLoad ->
LoadPostData.
My question is why does the LoadPostData occur *after* the OnLoad
instead of...
| |
by: Goober |
last post by:
I have a page that receives a session variable from the default.aspx.
On Page load, the code in Page load gets executed twice. So far, no
problem. It sets the session variable each time, correctly.
However, when I click on a menu item in that page, it then executes the
same page load twice, before transferring control (via a
response.redirect) to the new page. On the first pass through the page
load of the menu page, the session...
|
by: Reza Nabi |
last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a
placeholder dynamically based on the ctlName querystring passed in the URL.
Webform (LoadCtl.aspx) also passes a variable (targetId) in to the
usercontrol (IntergySite.aspx) by calling its setter method.
Currently, I am using if-then-else and hardcoded the User Control Object to
do casting and call the setter method.
Question: Is there any way I could load,...
|
by: Martin Eyles |
last post by:
Hi,
I have a .aspx page, but have not done any codeBehind for it. I use
javascript to open this page, and on my development server this is fine.
However, when I copy all the files to another server, and try running the
same thing there, the page takes an age to load. (Note, the pop-up window
opens quickly, but it takes a long time before the page opens in the
pop-up).
Does anyone have any idea why this is happening? Is there a problem...
|
by: ApexData |
last post by:
I'm starting a new project. A Personnel System. I have considered
opening a single bound form to the main employee table. The user can
scroll the records to any individual. I would like to have a tab
control at the top of the form which would allow the user to select
(PERSONAL), (TRAINING),(DISIPLINARY),and (SICKLEAVE) Tabs. Each Tab
should open a FORM and display the relavant TABLE of records tied to
the Employee being viewed in the...
|
by: AB |
last post by:
Hi,
I have this error "could not load type *****", and I don't know why.
I have tryed the microsoft solution of rebuilding (http://
support.microsoft.com/kb/306155) but it doesn't work.
If I try to remove the first row of the file, it's make some and some
errors yet of the some type.
You know how I can resolve this problem.
Ab@
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |