473,749 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tab control - Changing Page

553 Contributor
I have a Tab control on my form.

Can anyone guide me how to wirte a little code to switch from one page to another.

We can easily click on Page 1, Page, and so on but i need to create a button on each page to move to the next page.

Can anyone help

Thanks
Jul 7 '07 #1
11 6251
Robbie
180 New Member
I have a Tab control on my form.

Can anyone guide me how to wirte a little code to switch from one page to another.

We can easily click on Page 1, Page, and so on but i need to create a button on each page to move to the next page.

Can anyone help

Thanks
Just played around and that found this works for the TabStrip control:
Expand|Select|Wrap|Line Numbers
  1. Dim WantedIndex As Integer
  2.     WantedIndex = TabStrip.SelectedItem.Index
  3. 'Add 1 or subtract 1 from WantedIndex to go forward or behind by one...
  4.     TabStrip.Tabs(WantedIndex).Selected=True
  5.  
You'll then need to call the event which deals with stuff when a user clicks on a tab, because otherwise only the selected tab will change but the visible objects won't.
Jul 7 '07 #2
questionit
553 Contributor
Hi

Thanks

But my compiler gives me error on these:

SelectedItem
Tabs
These methods dont seems to be available in my version of VB.

Any idea why i get "no Sub or Function not defind" error ?


Just played around and that found this works for the TabStrip control:
Expand|Select|Wrap|Line Numbers
  1. Dim WantedIndex As Integer
  2.     WantedIndex = TabStrip.SelectedItem.Index
  3. 'Add 1 or subtract 1 from WantedIndex to go forward or behind by one...
  4.     TabStrip.Tabs(WantedIndex).Selected=True
  5.  
You'll then need to call the event which deals with stuff when a user clicks on a tab, because otherwise only the selected tab will change but the visible objects won't.
Jul 7 '07 #3
Robbie
180 New Member
Hi

Thanks

But my compiler gives me error on these:

SelectedItem
Tabs
These methods dont seems to be available in my version of VB.

Any idea why i get "no Sub or Function not defind" error ?
It says sub/function not defined because of Tabs(WantedInde x). It thinks I'm talking about a sub or a function, which we haven't yet made. I'm actually talking about the array Tabs() which should be part of the TabStrip, but it seems that array doesn't exist either, so...

- What version of VB are you using?
and
- When you click on the tabs object, in the form designer, in ther properties box, does it say "OptionsTab TabStrip"?
(Replacing OptionsTab with whatever you named it)
Or does it not say TabStrip?

Because, I'm using the TabStrip control in VB6.

If it says SSTab, that's the Microsoft Tabbed Dialog Control. That is much easier to set the selected tab of:

Expand|Select|Wrap|Line Numbers
  1. YourTabObject.tab = YourObject.tab + 1
  2. '(or -1 to go back by one tab)
  3.  
Jul 7 '07 #4
questionit
553 Contributor
I have VB 6.3

There is nothing called TabStrip at all.
Here, VB calls is Tab Control instead

and there is nothing like SSTab

Could you figure out the problem now?


It says sub/function not defined because of Tabs(WantedInde x). It thinks I'm talking about a sub or a function, which we haven't yet made. I'm actually talking about the array Tabs() which should be part of the TabStrip, but it seems that array doesn't exist either, so...

- What version of VB are you using?
and
- When you click on the tabs object, in the form designer, in ther properties box, does it say "OptionsTab TabStrip"?
(Replacing OptionsTab with whatever you named it)
Or does it not say TabStrip?

Because, I'm using the TabStrip control in VB6.

If it says SSTab, that's the Microsoft Tabbed Dialog Control. That is much easier to set the selected tab of:

Expand|Select|Wrap|Line Numbers
  1. YourTabObject.tab = YourObject.tab + 1
  2. '(or -1 to go back by one tab)
  3.  
Jul 7 '07 #5
Robbie
180 New Member
I have VB 6.3

There is nothing called TabStrip at all.
Here, VB calls is Tab Control instead

and there is nothing like SSTab

Could you figure out the problem now?
Either I don't have one of the controls in Components which you have (the tab control), or I do and I can't see it when I look for it. >_<

Can you please go to Project -> Components, and on the Controls tab, tell me everything which is ticked?
Jul 7 '07 #6
questionit
553 Contributor
I dont see Project menu.

I think probably i did not mention to you that i am using Ms Access Form and VB at back-end.




Either I don't have one of the controls in Components which you have (the tab control), or I do and I can't see it when I look for it. >_<

Can you please go to Project -> Components, and on the Controls tab, tell me everything which is ticked?
Jul 7 '07 #7
Robbie
180 New Member
I dont see Project menu.

I think probably i did not mention to you that i am using Ms Access Form and VB at back-end.
Ah, well in that case I'm sorry, I have no idea how to help, or even what is going on, really. >_<
Jul 7 '07 #8
questionit
553 Contributor
Can you help me with my other VBA problem :

I have a module called Stack with some code in it.
I have a Form which has some buttons on it.

When i try to compile the module, i get this error:

A module is not a valid type.

and this line is highlighted :
Dim myStack As Stack

any idea?
Jul 7 '07 #9
Robbie
180 New Member
Can you help me with my other VBA problem :

I have a module called Stack with some code in it.
I have a Form which has some buttons on it.

When i try to compile the module, i get this error:

A module is not a valid type.

and this line is highlighted :
Dim myStack As Stack

any idea?
Nope, because I am really only familiar with VB6, sorry...
Jul 7 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3380
by: Jaweed | last post by:
Hi I'm developing an ASP.NET app in Visual studio (using C# for code behind). My question is fairly simple (i think). When I go to the code behind page, the controls in the html page are made "protected" so that it can only be accessed from within that page. I would like to permanently make this "public" for certain controls, so that I can access them from another page (the page that a user control is embedded into for example). If I...
2
2961
by: Herb Stull | last post by:
I need to be able to change the background color of an ASP.NET page on the fly, in code. I see a bgcolor property on the Document and if I change that it does the job nicely, but I cannot find a way to change this in code... say in the Page_Load event. Any help is much appreciated. Thanks, Herb
1
1726
by: msnews.microsoft.com | last post by:
Calendar Control: Changing the Month Display and Navigation Links http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskCustomizingCalendarWebControlAppearance.asp The above link suggests a "Calendar.MonthNameFormat" that can be used to Specify the format of the name of the month (for example, full name or abbreviation) I can't seem to find the property in the Calandar Control!
2
1566
by: Chris Kettenbach | last post by:
Good Morning, I have a user control I dynamically load in the page_init event into a asp:placeholder control. This page also has another placeholder I would like to dynamically load controls into when the user takes an action on my first dynamically loaded control. Control 1 is a couple of asp:button controls. I am able to tap into their events, but in the code behind, I want the click event of one of the buttons to load another user...
4
1248
by: chuckdfoster | last post by:
Can I change the page title from my ASP.NET code? I know you can from classic ASP. Thanks in advance. -- Chuck Foster Programmer Analyst Eclipsys Corporation - St. Vincent Health System
12
4552
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do the following in our codebehind file....
3
6441
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property BarLabelText. I now have a contentpage "FooBar.aspx", where "Bar.master" is the master page and in the content section has the control "Foo.ascx".
3
2131
by: dcassar | last post by:
I am working on a complex server control that dynamically creates an HtmlInputHidden control that stores its value. As far as the postback process is concerned, this hidden input acts as the control itself. So when I render, I generate a proxy HtmlInputHidden like so: protected virtual void Render(HtmlTextWriter writer) { HtmlInputHidden hiddenInput = new HtmlInputHidden(); hiddenInput.ID = ClientID; hiddenInput.Name = UniqueID;
5
4417
by: charli | last post by:
I have a userform in Access/Excel with a Multipage control on. At the bottom of each multipage is a command button that sends you to the next page. When you click these command buttons, it changes which tab has focus at the top of the control, but the other controls on the multipage don't change, they stay as the old page. code to change page: Multipage1.value = multipage1.value + 1 I've tried putting form.repaint at the bottom, but that...
0
8997
marktang
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...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
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...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
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...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.