How to capture event of multiple Dynamic control in VB6.0 - vb6

Screenshot
In the above form, I have an SSTab. The Add Characteristics button is an added control to create rows of characteristics. On click of this button, I can keep adding Dynamic controls (Checkbox, Label, Text, Combobox and other controls.) Now I want to capture the Action. for Example, change of Text in Combobox or Change in CheckBox Status. I am not able to trap the Event to identify which control and what code will help me capture the action of a Dynamic Control (on the first Tab)
Can some one help me with a good solution? I have been desperately searching for over a month and have not got a solution so far.
Let me know how I can send the VB code as a ZIP file for reference over email.
Expectation:
1. I should be able to capture delete Row change in the check box
2. I should be able to capture changes in Combo box
Static Controls:
1. Form: frmcharacteristics
2. Button: cmdAddCharacteristics
3. SSTab: tabDisplay
Code in Module1:
Public SR_NO As Long
Public Top_Position As Long
code in frmCharacterisitcs:
Option Explicit
Dim WithEvents Ch_Delete_Row As CheckBox
Dim WithEvents Ch_SR_NO As Label
Dim WithEvents Ch_Name As TextBox
Dim WithEvents Ch_Type As ComboBox
Dim WithEvents Extended_Control As VBControlExtender
Private Sub cmdAddCharacteristics_Click()
Module1.SR_NO = Module1.SR_NO + 1
Set Ch_Delete_Row = frmCharacteristics.Controls.Add("VB.CheckBox", "Ch_Delete_Row" & (Module1.SR_NO), tabDisplay)
Ch_Delete_Row.Visible = True
Ch_Delete_Row.Top = Module1.Top_Position + 100
Ch_Delete_Row.Width = 1000
Ch_Delete_Row.Left = 500
Ch_Delete_Row.Caption = ""
Ch_Delete_Row.Height = 315
'MsgBox Ch_Delete_Row.Name
Set Ch_SR_NO = frmCharacteristics.Controls.Add("VB.Label", "Ch_SR_NO" & (Module1.SR_NO), tabDisplay)
Ch_SR_NO.Visible = True
Ch_SR_NO.Top = Module1.Top_Position + 200
Ch_SR_NO.Width = 750
Ch_SR_NO.Left = Ch_Delete_Row.Left + Ch_Delete_Row.Width + 400
Ch_SR_NO.Caption = Module1.SR_NO
Ch_SR_NO.Height = 315
Set Ch_Name = frmCharacteristics.Controls.Add("VB.TextBox", "Ch_Name" & (Module1.SR_NO), tabDisplay)
Ch_Name.Visible = True
Ch_Name.Top = Module1.Top_Position + 100
Ch_Name.Width = 2000
Ch_Name.Left = Ch_SR_NO.Left + Ch_SR_NO.Width + 200
Ch_Name.Text = ""
Ch_Name.Height = 315
Set Ch_Type = frmCharacteristics.Controls.Add("VB.ComboBox", "Ch_Type" & (Module1.SR_NO), tabDisplay)
Ch_Type.Visible = True
Ch_Type.Top = Module1.Top_Position + 100
Ch_Type.Width = 1500
Ch_Type.Left = Ch_Name.Left + Ch_Name.Width + 50
Ch_Type.Text = ""
'Ch_Type.Height = 315
Ch_Type.AddItem "Service"
Ch_Type.AddItem "Special"
Ch_Type.AddItem "Option"
Module1.Top_Position = Module1.Top_Position + 400
End Sub
Private Sub Form_Load()
Module1.SR_NO = 0
Dim Test_Line As Control
Set Test_Line = frmCharacteristics.Controls.Add("VB.Line", "LINE", frmCharacteristics)
Test_Line.Visible = True
Test_Line.X1 = 100
Test_Line.Y1 = 600
Test_Line.X2 = frmCharacteristics.Width
Test_Line.Y2 = 600
Top_Position = Test_Line.Y1
frmCharacteristics.Show
tabDisplay.Width = frmCharacteristics.Width - 1000
tabDisplay.Height = frmCharacteristics.Height - 1500
tabDisplay.Left = frmCharacteristics.Left + 200
Call set_labels
End Sub
Sub set_labels()
Dim Label_SR_NO As Control
Dim Label_Name As Control
Dim Label_Delete_Row As Control
Dim Label_Type As Control
Set Label_Delete_Row = frmCharacteristics.Controls.Add("VB.Label", "Label_Delete_Row" & (Module1.SR_NO), tabDisplay)
Label_Delete_Row.Visible = True
Label_Delete_Row.Top = Module1.Top_Position + 100
Label_Delete_Row.Width = 1000
Label_Delete_Row.Left = 300
Label_Delete_Row.Caption = "Delete(Y/N)"
Label_Delete_Row.Height = 315
Set Label_SR_NO = frmCharacteristics.Controls.Add("VB.Label", "Label_SR_NO" & (Module1.SR_NO), tabDisplay)
Label_SR_NO.Visible = True
Label_SR_NO.Top = Module1.Top_Position + 100
Label_SR_NO.Width = 750
Label_SR_NO.Left = Label_Delete_Row.Left + Label_Delete_Row.Width + 400
Label_SR_NO.Caption = "SR_NO"
Label_SR_NO.Height = 315
Set Label_Name = frmCharacteristics.Controls.Add("VB.Label", "Label_Name" & (Module1.SR_NO), tabDisplay)
Label_Name.Visible = True
Label_Name.Top = Module1.Top_Position + 100
Label_Name.Width = 2000
Label_Name.Left = Label_SR_NO.Left + Label_SR_NO.Width + 400
Label_Name.Caption = "Characteristics Name"
Label_Name.Height = 315
Set Label_Type = frmCharacteristics.Controls.Add("VB.Label", "Label_Type" & (Module1.SR_NO), tabDisplay)
Label_Type.Visible = True
Label_Type.Top = Module1.Top_Position + 100
Label_Type.Width = 1500
Label_Type.Left = Label_Name.Left + Label_Name.Width + 50
Label_Type.Caption = "Charac. Type"
Label_Type.Height = 315
Module1.Top_Position = Module1.Top_Position + 400
End Sub

Related

ABCPDF Reading PDF as background image, next page doesnt render

We have 4 Html pages that we are joining together into 1 file.
For the first page, we are reading a blank PDF file (letter head) to add as the background and then add the further 3 pages.
However, all seemed ok in version 8, but now the second page will not show.
thedoc reads the blank pdf and then the html page which overlays the text no issue here.
thedoc1 is the second page which will not load
thedoc1a and thedoc2 load ok.
If I remove the adding of the letter head from thedoc, then all 4 pages load ok, but as soon as I try and use the letter head, the second page doesnt load.
Ive added my script below. What I am doing wrong please
Sub page_load()
Dim rs
Dim strSQLQuery As String
Dim theDoc As Doc = New Doc()
Dim theDoc1 As Doc = New Doc()
Dim theDoc1a As Doc = New Doc()
Dim theDoc2 As Doc = New Doc()
Dim theDoccontents As Doc = New Doc()
theDoc.MediaBox.String = "A4"
theDoc1.MediaBox.String = "A4"
theDoc1a.MediaBox.String = "A4"
theDoc2.MediaBox.String = "A4
theDoc.HtmlOptions.PageCacheEnabled = False
theDoc.HtmlOptions.PageCacheClear()
theDoc.HtmlOptions.ImageQuality = 33
theDoc1.HtmlOptions.ImageQuality = 33
theDoc1a.HtmlOptions.ImageQuality = 33
theDoc2.HtmlOptions.ImageQuality = 33
theDoc.HtmlOptions.AddLinks = True
theDoc1.HtmlOptions.AddLinks = True
theDoc1a.HtmlOptions.AddLinks = True
theDoc2.HtmlOptions.AddLinks = True
theDoc.HtmlOptions.Timeout = 10000000
theDoc1.HtmlOptions.Timeout = 10000000
theDoc1a.HtmlOptions.Timeout = 10000000
theDoc2.HtmlOptions.Timeout = 10000000
Dim rbrandchosen As String
Dim quotenumber As String
Dim rnum As String
Dim cover as string
dim pagex as integer
quotenumber=request("quotenumber")
rbrandchosen=request("rbrandchosen")
response.write(quotenumber)
Dim theURL As String
Dim theID As Integer
Dim strsql as string
Dim theSection as string
Dim theCountDoc1a As Integer
Randomize()
rnum = (CInt(Math.Floor(90 * Rnd())) + 10).ToString
' add covering letter
cover = "c:\\inetpub\\wwwroot\\icopalukintranet\\pnf\\letterhead.pdf"
theDoc.Read(cover)
'theID = theDoc.AddObject("<< >>")
theDoc.HtmlOptions.UseScript = True
theDoc.HtmlOptions.Engine = EngineType.Chrome86
' Render after 2 seconds
theDoc.Rect.SetRect(20, 110, 600, 620)
theDoc.HtmlOptions.OnLoadScript = "(function(){ window.ABCpdf_go = false; setTimeout(function(){ window.ABCpdf_go = true; }, 3000); })();"
theURL = "http://localhost/icopalukintranet/pnf/rooflights/rooflightquotepdfletter.asp?quotenumber="+ quotenumber + "&stridrnd="+rnum
'theDoc.AddImageUrl(theURL)
theID = theDoc.AddImageUrl(theURL)
While True
If Not theDoc.Chainable(theID) Then
Exit While
End If
theDoc.Page = theDoc.AddPage()
theID = theDoc.AddImageToChain(theID)
End While
' add quote
theDoc1.HtmlOptions.Engine = EngineType.Chrome86
theDoc1.HtmlOptions.UseScript = True
theDoc1.Rect.SetRect(0, 0, 600, 820)
' Render after 2 seconds
theDoc1.HtmlOptions.OnLoadScript = "(function(){ window.ABCpdf_go = false; setTimeout(function(){ window.ABCpdf_go = true; }, 2000); })();"
theURL = "http://localhost/icopalukintranet/pnf/rooflights/rooflightquotepdfquote.asp?quotenumber="+ quotenumber + "&stridrnd="+rnum
theDoc1.Page = theDoc1.AddPage()
theID = theDoc1.AddImageUrl(theURL)
While True
If Not theDoc1.Chainable(theID) Then
Exit While
End If
theSection = "Quote"
theDoc1.Page = theDoc1.AddPage()
theID = theDoc1.AddImageToChain(theID)
theDoc1.AddBookmark(theSection, True)
End While
' add notes
theDoc1a.HtmlOptions.Engine = EngineType.Chrome86
theDoc1a.HtmlOptions.UseScript = True
theDoc1a.Rect.SetRect(0, 0, 600, 820)
' Render after 3 seconds
theDoc1a.HtmlOptions.OnLoadScript = "(function(){ window.ABCpdf_go = false; setTimeout(function(){ window.ABCpdf_go = true; }, 1000); })();"
theURL = "http://localhost/icopalukintranet/pnf/rooflights/rooflightquotepdfnotes.asp?quotenumber="+ quotenumber + "&stridrnd="+rnum
theDoc1a.Page = theDoc1a.AddPage()
theID = theDoc1a.AddImageUrl(theURL)
While True
If Not theDoc1a.Chainable(theID) Then
Exit While
End If
theDoc1a.Page = theDoc1a.AddPage()
theID = theDoc1a.AddImageToChain(theID)
End While
' add terms details
theDoc2.HtmlOptions.Engine = EngineType.Chrome86
theDoc2.HtmlOptions.UseScript = True
theDoc2.Rect.SetRect(20, 80, 560, 710)
theDoc2.Transform.Magnify(0.93 ,0.93, 0, 690)
' Render after 1 seconds
theDoc2.HtmlOptions.OnLoadScript = "(function(){ window.ABCpdf_go = false; setTimeout(function(){ window.ABCpdf_go = true; }, 2000); })();"
theURL = "http://localhost/icopalukintranet/pnf/rooflights/rooflightquotepdfterms.asp?quotenumber="+ quotenumber + "&stridrnd="+rnum
theDoc2.Page = theDoc2.AddPage()
theID = theDoc2.AddImageUrl(theURL)
While True
If Not theDoc2.Chainable(theID) Then
Exit While
End If
theSection = "Terms"
theDoc2.Page = theDoc2.AddPage()
theID = theDoc2.AddImageToChain(theID)
theDoc2.AddBookmark(theSection, True)
End While
Dim cst = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("rooflightquotes.mdb")
Dim conn = CreateObject("ADODB.Connection")
conn.open(cst)
Session("myConn") = conn
dim rsAddquestion = Server.CreateObject("ADODB.Recordset")
strsql ="select * from pdfs where id=" & quotenumber & " "
rsAddquestion.Open(strsql, conn, 3, 3)
dim n as string
n=rsAddquestion.recordcount
rsAddquestion.AddNew
n=n+1
rsAddquestion("id")=quotenumber
rsAddquestion("pdfname") =quotenumber +"-rev"+n+".pdf"
rsAddquestion("printdate")=now()
rsAddquestion("status")="Printed"
rsAddquestion.update
rsAddquestion = Server.CreateObject("ADODB.Recordset")
strsql ="select * from header where id=" & quotenumber & " "
rsAddquestion.Open(strsql, conn, 3, 3)
rsAddquestion("status")="Printed"
rsAddquestion.update
conn.close
' add the pdf together in selected order
theDoc.Append(theDoc1)
theDoc.Append(theDoc1a)
theDoc.Append(theDoc2)
Dim theCount = theDoc.PageCount
' left bottom width heght
theDoc.Rect.String = "10 10 580 25"
theDoc.HPos = 1.0
theDoc.VPos = 0.5
theDoc.Color.String = "255 255 255"
theDoc.Font = theDoc.AddFont("Arial")
theDoc.FontSize = 10
For i = 1 To theCount
theDoc.PageNumber = i
If i <> 1 Then
theDoc.AddHtml(" Page " + i.ToString() + " of " + theCount.ToString() + "")
theDoc.FrameRect()
End If
Next
dim pdffilenamec = "pdf/"+quotenumber+"-rev"+n+".pdf"
theDoc.Save(Server.MapPath(pdffilenamec))
'response.redirect("rooflightquotepdfmenu.asp?quotenumber="+quotenumber)
End Sub
This used to work find in version 8, but not now using version 12

Import XML Data thru MSFlexigrid to SQL Table using vb6

My VB6 code reads XML file
loads into MSFLEXIGRID
loops through each record, if I see a break point,
does not add data in sql table except one record why it is happening does not know. does not throw any error.
I'm appending my code below:
Private Sub cmdPrint_Click()
Dim rsMtrData As New ADODB.Recordset
Dim irow As Integer
rsClose rsMtrData
rsMtrData.Open "select * from Master_Meter_Reading ", cn, adOpenKeyset, adLockPessimistic
With MSFlexGrid1
rsMtrData.AddNew
For irow = 0 To .Rows - 1
.Row = irow
.Col = 0
rsMtrData!Snapshot = .text & ""
.Col = 1
rsMtrData!LoadSurveyDTime = Format(.text, "dd-MM-yyyy hh:mm:SS")
.Col = 2
rsMtrData!LoadSurveyDateDay = g_ConvertNumber(.text)
.Col = 3
rsMtrData!LoadSurveyDate = Format(.text, g_DateFormat)
.Col = 4
rsMtrData!LoadSurveyDateParmVal = g_ConvertNumber(.text)
.Col = 5
rsMtrData!LoadSurveyType = .text & ""
.Col = 6
rsMtrData!LoadSurveyUnit = g_ConvertNumber(.text)
.Col = 7
rsMtrData!LoadSurveySlipValParmVal = .text & ""
.Col = 8
rsMtrData!LoadSurveySlipValParmValTime = g_ConvertNumber(.text)
rsMtrData.Update
Next irow
End With
MsgBox "Data Successfully Saved", vbInformation
End Sub
You are only adding one record then updating it. At the moment the AddNew is on the outside of the loop. If you change the code and move the AddNew inside the For..Next loop it should add more rows.
Your code would look something like this:
Private Sub cmdPrint_Click()
Dim rsMtrData As New ADODB.Recordset
Dim irow As Integer
rsClose rsMtrData
rsMtrData.Open "select * from Master_Meter_Reading ", cn, adOpenKeyset, adLockPessimistic
With MSFlexGrid1
For irow = 0 To .Rows - 1
rsMtrData.AddNew 'This is the line that has moved from outside to inside the loop.
.Row = irow
.Col = 0
rsMtrData!Snapshot = .text & ""
.Col = 1
rsMtrData!LoadSurveyDTime = Format(.text, "dd-MM-yyyy hh:mm:SS")
.Col = 2
rsMtrData!LoadSurveyDateDay = g_ConvertNumber(.text)
.Col = 3
rsMtrData!LoadSurveyDate = Format(.text, g_DateFormat)
.Col = 4
rsMtrData!LoadSurveyDateParmVal = g_ConvertNumber(.text)
.Col = 5
rsMtrData!LoadSurveyType = .text & ""
.Col = 6
rsMtrData!LoadSurveyUnit = g_ConvertNumber(.text)
.Col = 7
rsMtrData!LoadSurveySlipValParmVal = .text & ""
.Col = 8
rsMtrData!LoadSurveySlipValParmValTime = g_ConvertNumber(.text)
rsMtrData.Update
Next irow
End With
MsgBox "Data Successfully Saved", vbInformation
End Sub

visual basic 6: create an object in other form

i would like create a rectangle in a different picture.
For example: the code is inside testpicture, but i would like that this rect is create in testpicture2.
How is possible please ?
Thank you very much
The solution...
Private Sub GenerateRuntimeForm()
Dim ctrl As Control
Set frm = New Form1
Set cmdOK = Nothing
Set cmdCancel = Nothing
Set txtInput = Nothing
Set lblDisplay = Nothing
'clear the form
For Each ctrl In frm
ctrl.Visible = False
Next
Set cmdOK = frm.Controls.Add("VB.CommandButton", "cmdOK")
Set cmdCancel = frm.Controls.Add("VB.CommandButton", "cmdCancel")
Set txtInput = frm.Controls.Add("VB.TextBox", "txtInput")
Set lblDisplay = frm.Controls.Add("VB.Label", "lblDisplay")
With frm
'Set form's width and height
.Width = 4000
.Height = 2500
.Caption = "Run-Time Generated Form"
End With
'Setup rest of controls
With lblDisplay
.Top = 250
.Left = 250
.AutoSize = True
.FontBold = True
.Caption = IIf(allowNumericOnly, "Enter Your Age:", "Enter Your Last Name:")
End With
With txtInput
.Top = lblDisplay.Top + lblDisplay.Height + 250
.Left = 250
.Height = 295
If allowNumericOnly Then
.Width = 500
.MaxLength = 3
Else
.Width = 2500
End If
End With
With cmdOK
.Top = txtInput.Top + txtInput.Height + 375
.Width = 800
.Left = 1000
.Height = cmdGenerate(0).Height
cmdOK.Caption = "&OK"
.Enabled = False
End With
With cmdCancel
.Left = cmdOK.Left + cmdOK.Width + 100
.Top = cmdOK.Top
.Width = cmdOK.Width
.Height = cmdOK.Height
.Caption = "&Cancel"
End With
cmdOK.Visible = True
cmdCancel.Visible = True
lblDisplay.Visible = True
txtInput.Visible = True
frm.Show vbModal
End Sub

Error code Overflow and wildcard not working Excel VBA

In the following code, I get an error at line pec1 = pec+1, in which is indicated to be some 30000 number. pec6, pec3, pec5 all also have numbers greater than 1000.
Also looking a little further down, when I do a wildcard search 72-41-* for the numbers like 72-41-00, 72-41-13, it gives a return value of 0.
Thank you so much for helping me.
*update: Please help me. Excel now stops running after I try to run the program. :(
Sheets("Sheet1").Select
Dim egr As String, pec1 As Long, pec2 As Long, pec3 As Long
Dim pec4 As Long
Dim pec5 As Long
Dim pec6 As Long
Dim lastroww As Long
Dim k As Long
Dim h As Long
Dim om As String
egr = ""
pec1 = 0
pec2 = 0
pec3 = 0
pec4 = 0
pec5 = 0
pec6 = 0
dummy = 0
k = 4
With Sheet1
.AutoFilterMode = False
.Range("A3:K3").AutoFilter
.Range("A3:K3").AutoFilter Field:=3, Criteria1:="05.00 PEC"
End With
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
lastroww = lastrow - 3
Do Until Cells(k, 4).Value = ""
For k = 4 To lastroww
pm = Cells(k, 8).Value
If pm = "" Then
pec6 = pec6 + 1
ElseIf pm = "Semais,June" Then
pec1 = pec1 + 1
ElseIf pm = "Mwier,Robert" Then
pec3 = pec3 + 1
ElseIf pm = "Newton,Sally" Then
pec5 = pec5 + 1
End If
om = Cells(k, 7).Value
If om = "" Then
ElseIf om = "72-41*" Then
pec2 = pec2 + 1
ElseIf om = "72-51*" Or om = "72-52-*" Or om = "72-53-*" Then
pec4 = pec4 + 1
End If
Next k
Loop

How To Read the TextBox value which is dynamically added into gridview on ajax tab container

I'm facing difficult condition to read the value from text box which is dynamically added into gridview which is inside TabPanel of AjaxTabContainer.
Note, all controls are added dynamically as per user options.
The sequence would be as follow:
Design Time:
One Panel and other user options (date & some other fields)
Run Time:
- Add AjaxTab container & Tab Panel which is vary upon user filter (Tab created based on db -records)
- Inside each tab, added the GridView with dataset
- Add some textbox into each of GridView Line
On Page:
I can successfully show tab control with gridview with text box (*as below)
Now, how to read value inside each text box when user click 'Update' button?
I try to use FindControls, but nothing.
My code:-
Private Sub DynamicTabGVLoad(ByVal seqno As String)
createTab()
ds = allotmentdb.getRoomType()
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
Dim tabcontent As New Control()
Dim tbldynamic As New Table()
Dim tbrdynamic As New TableRow()
Dim tbcdynamic As New TableCell()
Dim roomtypekey As String
roomtypekey = ds.Tables(0).Rows(i)("roomtypekey").ToString()
Dim gv_alines As New GridView
gv_alines.AutoGenerateColumns = True
gv_alines.Attributes.Add("runat", "server")
Dim ds1 As New Data.DataSet()
ds1 = allotmentdb.getAllotmentLinesTabGV(roomtypekey, seqno, System.DateTime.Now.ToString(("yyyy-MM-dd")))
gv_alines.EmptyDataText = "No Record Found!"
'gv_alines.ShowHeaderWhenEmpty = True
gv_alines.DataSource = ds1
gv_alines.DataBind()
If gv_alines.Rows.Count > 0 Then
gv_alines.HeaderRow.Cells(0).Visible = False
gv_alines.HeaderRow.Cells(1).Visible = False
gv_alines.HeaderRow.Cells(4).Visible = False
For Each gvr As GridViewRow In gv_alines.Rows
gvr.Cells(0).Visible = False
gvr.Cells(1).Visible = False
gvr.Cells(4).Visible = False
Dim txtInternetRoom As New TextBox()
txtInternetRoom.ID = "txtInternetRoom"
txtInternetRoom.Text = gvr.Cells(5).Text
txtInternetRoom.Style.Add("text-align", "right")
txtInternetRoom.Width = 100
gvr.Cells(5).Controls.Add(txtInternetRoom)
Dim txtInternetRate As New TextBox()
txtInternetRate.ID = "txtInternetRate"
txtInternetRate.Text = FormatNumber(gvr.Cells(6).Text, 2)
If txtInternetRate.Text = "0.00" Then txtInternetRate.Text = "NA"
txtInternetRate.Style.Add("text-align", "right")
txtInternetRate.Width = 100
gvr.Cells(6).Controls.Add(txtInternetRate)
Dim txtInternetRate2 As New TextBox()
txtInternetRate2.ID = "txtInternetRate2"
txtInternetRate2.Text = FormatNumber(gvr.Cells(7).Text)
If txtInternetRate2.Text = "0.00" Then txtInternetRate2.Text = "NA"
txtInternetRate2.Style.Add("text-align", "right")
txtInternetRate2.Width = 100
gvr.Cells(7).Controls.Add(txtInternetRate2)
Dim txtInternetRate3 As New TextBox()
txtInternetRate3.ID = "txtInternetRate3"
txtInternetRate3.Text = FormatNumber(gvr.Cells(8).Text)
If txtInternetRate3.Text = "0.00" Then txtInternetRate3.Text = "NA"
txtInternetRate3.Style.Add("text-align", "right")
txtInternetRate3.Width = 100
gvr.Cells(8).Controls.Add(txtInternetRate3)
Dim txtInternetRate4 As New TextBox()
txtInternetRate4.ID = "txtInternetRate4"
txtInternetRate4.Text = FormatNumber(gvr.Cells(9).Text)
If txtInternetRate4.Text = "0.00" Then txtInternetRate4.Text = "NA"
txtInternetRate4.Style.Add("text-align", "right")
txtInternetRate4.Width = 100
gvr.Cells(9).Controls.Add(txtInternetRate4)
Next
Else
End If
tbcdynamic.Controls.Add(gv_alines)
tbrdynamic.Cells.Add(tbcdynamic)
tbldynamic.Rows.Add(tbrdynamic)
tabcontent.Controls.Add(tbldynamic)
ajxTab.Tabs(i).Controls.Add(tabcontent)
Next
pnlDynamic.Controls.Add(ajxTab)
End Sub
Private Sub createTab()
ds = allotmentdb.getRoomType()
ajxTab = New AjaxControlToolkit.TabContainer()
ajxTab.Attributes.Add("runat", "server")
'Me.Controls.Add(ajxTab)
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
Dim tbpnlDynamic As New TabPanel()
tbpnlDynamic.Attributes.Add("runat", "server")
tbpnlDynamic.HeaderText = ds.Tables(0).Rows(i)("RoomType").ToString()
tbpnlDynamic.ID = ds.Tables(0).Rows(i)("RoomTypeKey").ToString()
tbpnlDynamic.Visible = True
ajxTab.Tabs.Add(tbpnlDynamic)
ajxTab.ActiveTabIndex = 0
Next
End Sub
I need it very urgently. Thanks in advance!

Resources