1 Replies - 574 Views - Last Post: 27 November 2012 - 02:29 PM Rate Topic: -----

#1 CodyMcCoderson  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 08-October 12

Question About Tabs

Posted 27 November 2012 - 01:34 PM

Hey guys, I have what I believe should problem be a simple question.
Ive had my head stuck on this for about an hour and just searched the internet with no luck.

So here it is.

I have the following code. I need the code to write the 'data()' to the tabpage, NOT the tab name itself.

My tabs are named: Answer 1, Answer 2, Answer 3, Answer 4.

But with my code they rename to the piece of text file I have specified.

I know the reason its wrong is because it says tabpage.text = data() but what would I put in place of .text to make it write to the page and not the tab title itself?

Public Class Form1
    Dim data() As String
    Dim numOfQuestions As Integer = 0
    Const partsOfQuestion As Integer = 5
    Public quizQuestions(0, partsOfQuestion) As String
    Dim questions As ArrayList = New ArrayList
    Dim position As Integer
    Private fileread As New System.IO.StreamReader("file2.txt")

    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
        Data = fileread.ReadLine().Split(",") 'reads the file to the app depending on the data chosen.

        TabPage1.Text = data(1)
        TabPage2.Text = data(2)
        TabPage3.Text = data(3)
        TabPage4.Text = data(4)
        answercb.Text = data(5)
    End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Question About Tabs

#2 lucky3  Icon User is offline

  • Friend lucky3 As IHelpable
  • member icon

Reputation: 233
  • View blog
  • Posts: 770
  • Joined: 19-October 11

Re: Question About Tabs

Posted 27 November 2012 - 02:29 PM

Throw a Label or TextBox... on each of the TabPages, and assign value of indexes in data array to their .Text properties.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1