473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Tabs In C#

I want to use tabs on a form and well as some data fields.

What I want to do is each tab is additional data which needs to be saved
when the Ok button is pressed on the form.

How from the main form OK method can I access the individual data fields
on each tab so that I can use a single SQL statement to update my data.

Thanks in advance
Jeff
Feb 18 '07 #1
4 8601
You can try making the fields public (or internal). This should allow
you to access them wherever you know a reference to the parent
TabPage. (You also may need to declare the TabControl public or
internal as well depending on whether the 'main' form you mentioned
has a reference to the TabControl).

=================
Clay Burch
Syncfusion, Inc.
Feb 18 '07 #2
On Feb 18, 10:38 am, Jeff Williams <jeff.willi...@hardsoft.com.au>
wrote:
I want to use tabs on a form and well as some data fields.

What I want to do is each tab is additional data which needs to be saved
when the Ok button is pressed on the form.

How from the main form OK method can I access the individual data fields
on each tab so that I can use a single SQL statement to update my data.

Thanks in advance
Jeff
The TabControl contains a property named, TabPages, a collection of
TabPage objects. On the other hand, each TabPage has got a Tag
property that gets or sets the object that contains data about the
control. You may use the Tag property to associated whatever data you
need with a given tab.

Hope this helps,

Feb 18 '07 #3
I would keep a reference as a private variable to whatever tab is
selected. Then add a function to return the selected tabpage to the
main form so the OK method can reference the values included in that tab
page. I would also include in the tabpage.tag proerty some sort of
identifier so you know which values you are working with, which is what
mehdi mentions. This way, the form with the tabpages keeps control of
its pages, and the main form is provided access to the currently
selected page.

T

Jeff Williams wrote:
I want to use tabs on a form and well as some data fields.

What I want to do is each tab is additional data which needs to be
saved when the Ok button is pressed on the form.

How from the main form OK method can I access the individual data
fields on each tab so that I can use a single SQL statement to update
my data.

Thanks in advance
Jeff
Feb 18 '07 #4
Jeff Williams wrote:
I want to use tabs on a form and well as some data fields.

What I want to do is each tab is additional data which needs to be saved
when the Ok button is pressed on the form.

How from the main form OK method can I access the individual data fields
on each tab so that I can use a single SQL statement to update my data.

Thanks in advance
Jeff
Control's placed in tabs>tabpages are automatically visible to the
parent form.
Form
Tab
Page 1
Label1
Label2

Form can access label1 and 2 if done via the visual designer.

JB
Feb 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan Jacobson | last post by:
In wdg-html-reference/html40/block/pre.html there is no mention about how ASCII tabs (^I) are to be rendered. I suppose all bets are off? Wait, my docs go thru html-tidy first, and it says...
2
by: Jim Hubbard | last post by:
I need an example of tabs usage like you might do in a tabbed browser application. I need to be able to open one or more tabs with customer data. Every tab is laid out exactly alike, only the...
1
by: Bill Gates | last post by:
Hello, I am creating oblique tabs for a webapp. It needs to be oblique tabs, and not regular tabs that you see in web browsers. Here's how it looks like: http://auriance.com/docs/interaction/ As...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
6
by: Stephen Edwards | last post by:
I am a novice, so bear with me. I designed a website using CSS TABS, all was fine, then I copy and pasted meta name, etc for keywords, tweaking it where necessary for keywords. I did not notice...
15
by: Tom Plunket | last post by:
The documentation for dedent says, "Remove any whitespace than can be uniformly removed from the left of every line in `text`", yet I'm finding that it's also modifying the '\t' characters, which...
35
by: Ben | last post by:
Hi, I have a python script on a unix system that runs fine. I have a python script on a windows system that runs fine. Both use tabs to indent sections of the code. I now want to run them on the...
0
by: doos | last post by:
Does anybody else find the handling of tabs by sql 2005 annoying, I've went as far to post a comment/suggestion to the Microsoft connect site, ...
5
by: wayniac | last post by:
I have a database built on 4 tabs, but inside one of those tabs I would like another group of tabs. The problem is that my second group of tabs are being displayed on ALL of the main 4 tabs and not...
7
by: Phil Reynolds | last post by:
I'm using a tab control in Access 2000, and the user requested to have buttons in the form header, instead of the built-in tabs (so that when they scroll down, they can still switch tabs). Now,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.