Wrox Programmer Forums
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 24th, 2004, 06:40 PM
Registered User
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to jaimini
Default Answer this code question

I want to enter data from the database to the combobox whenever the tab gets selected or on click of tab
my code is down below

Private Sub frmTouristAttractions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If tabattractions.Tag = 0 Then
                Dim strsql As String
                Dim dt As New DataTable
                strsql = "select event_name from Events_Info"

                Dim dataadapter As New Odbc.OdbcDataAdapter(strsql, con)
                For i = 0 To dt.Rows.Count - 1
                Next i
            Catch ex As Exception
            End Try
        End If
        If tabattractions.Tag = 1 Then
            MsgBox("TAB 1")

        End If
        If tabattractions.Tag = 2 Then
            MsgBox("TAB 2")
        End If

    End Sub
Please help me out with this
how should i put this code on click event of particular tag or whenver the tag gets selected .. because click event is not working

Old November 24th, 2004, 09:25 PM
Registered User
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Excuse me?

You should not be forcing other people to answer your question. The most obvious reason being that people would see it as an order and secondly, this is not the right forum for this question. May be a VB.NET-specific question. Dunno

Old November 25th, 2004, 10:50 AM
Authorized User
Join Date: Sep 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Brettvan1

Oh relax wannabe !

He's not forcing anyone to do anything, just looking for some help !

Old November 27th, 2004, 07:10 AM
Friend of Wrox
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts

Add click event for TabControl (note here it is not TabPage, TabControl is a collection of TabPage(s)) as follows to find which tabpage have been clicked.

private void tabControl1_Click(object sender, EventArgs e)

    if(((TabControl)sender).SelectedTab == tabPage1 )
        MessageBox.Show ("Tab 1");
    else if(((TabControl)sender).SelectedTab == tabPage2 )
        MessageBox.Show ("Tab 2");

Hope this helps!

It is not how much we do,
but how much love we put in the doing.

-Mother Theresa

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question and Answer DTD ROCXY XML 2 November 29th, 2008 01:15 AM
Question and Answer Moduel ROCXY All Other Wrox Books 2 November 29th, 2008 01:14 AM
Book does not seem to answer my question Alfred BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 0 October 31st, 2008 11:47 AM
This has to be a simple question to answer. Bill_Thompson Beginning VB 6 1 March 7th, 2006 01:04 PM
Common question, not so common answer? flyin ADO.NET 5 March 24th, 2004 06:50 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.