Vb.net HTA提示符/VB代码-尝试显示2个下拉列表
我有一个使用VB代码的HTA提示符。我需要在表上显示两个下拉列表。出于某种原因,“选择扇区”只显示了第二个下拉列表。当只有一个下拉列表时效果很好,但当我为扇区添加第二个下拉列表时,它删除了第一个位置下拉列表。如何使两个下拉列表都显示出来,使其像: 选择当前位置:[下拉列表]Vb.net HTA提示符/VB代码-尝试显示2个下拉列表,vb.net,hta,Vb.net,Hta,我有一个使用VB代码的HTA提示符。我需要在表上显示两个下拉列表。出于某种原因,“选择扇区”只显示了第二个下拉列表。当只有一个下拉列表时效果很好,但当我为扇区添加第二个下拉列表时,它删除了第一个位置下拉列表。如何使两个下拉列表都显示出来,使其像: 选择当前位置:[下拉列表] 'AA Sites Function startSTAGE3() ON ERROR RESUME NEXT LASTSTAGE = STAGE bodystring = "<br&
'AA Sites
Function startSTAGE3()
ON ERROR RESUME NEXT
LASTSTAGE = STAGE
bodystring = "<br>Select your current location: <SELECT SIZE='.5' NAME='Clocation' ONCHANGE='LOCCHANGED()'>"
bodystring = bodystring & "<option value='0'> </option>"
bodystring = bodystring & "<option value='MacDill AFB, FL, APO, AA'"
If locationindex = 1 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">MacDill AFB, FL, APO, AA</option></SELECT>"
bodystring = "<br><br><br>Select your sector: <SELECT SIZE='.3' NAME='Csector' ONCHANGE='SECTORCHANGED()'>"
bodystring = bodystring & "<option value='0'> </option>"
bodystring = bodystring & "<option value='ES'"
If sectorindex = 1 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">ES</option><option value='L&A'"
If sectorindex = 2 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">L&A</option><option value='I&S'"
If sectorindex = 3 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">I&S</option><option value='S2'"
If sectorindex = 4 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">S2</option><option value='INC'"
If sectorindex = 5 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">INC</option></SELECT>"
Function SECTORCHANGED()
ON ERROR RESUME NEXT
currentsector = Csector(Csector.selectedIndex).Value
sectorindex = Csector.selectedIndex
End Function
Function LOCCHANGED()
ON ERROR RESUME NEXT
currentlocation = Clocation(Clocation.selectedIndex).Value
locationindex = Clocation.selectedIndex
End Function
选择您的扇区:[下拉列表]
'AA Sites
Function startSTAGE3()
ON ERROR RESUME NEXT
LASTSTAGE = STAGE
bodystring = "<br>Select your current location: <SELECT SIZE='.5' NAME='Clocation' ONCHANGE='LOCCHANGED()'>"
bodystring = bodystring & "<option value='0'> </option>"
bodystring = bodystring & "<option value='MacDill AFB, FL, APO, AA'"
If locationindex = 1 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">MacDill AFB, FL, APO, AA</option></SELECT>"
bodystring = "<br><br><br>Select your sector: <SELECT SIZE='.3' NAME='Csector' ONCHANGE='SECTORCHANGED()'>"
bodystring = bodystring & "<option value='0'> </option>"
bodystring = bodystring & "<option value='ES'"
If sectorindex = 1 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">ES</option><option value='L&A'"
If sectorindex = 2 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">L&A</option><option value='I&S'"
If sectorindex = 3 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">I&S</option><option value='S2'"
If sectorindex = 4 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">S2</option><option value='INC'"
If sectorindex = 5 Then bodystring = bodystring & " selected"
bodystring = bodystring & ">INC</option></SELECT>"
Function SECTORCHANGED()
ON ERROR RESUME NEXT
currentsector = Csector(Csector.selectedIndex).Value
sectorindex = Csector.selectedIndex
End Function
Function LOCCHANGED()
ON ERROR RESUME NEXT
currentlocation = Clocation(Clocation.selectedIndex).Value
locationindex = Clocation.selectedIndex
End Function
AA站点
函数startSTAGE3()
出错时继续下一步
最后阶段
bodystring=“选择当前位置:” bodystring=bodystring&“” 腰线=腰线和“MacDill AFB、FL、APO、AA” bodystring=“
选择您的扇区:” bodystring=bodystring&“” bodystring=bodystring&“ESL&AI&SS2INC” 函数SECTORCHANGED() 出错时继续下一步 currentsector=Csector(Csector.selectedIndex).Value sectorindex=Csector.selectedIndex 端函数 函数LOCCHANGED() 出错时继续下一步 currentlocation=clo阳离子(clo阳离子.selectedIndex).Value locationindex=Clocation.selectedIndex 端函数
首先,您缺少第一个函数的
结束函数
秒,而不是使用:
bodystring = bodystring & [...]
我建议:
bodystring += [...]
它更容易阅读,而且更不用说你的代码了
第三个,在此处使用前覆盖您的bodystring
:
bodystring = bodystring & ">MacDill AFB, FL, APO, AA</option></SELECT>"
'The next commands overwrites bodystring before it is being used
bodystring = "<br><br><br>Select your sector: <SELECT SIZE='.3' NAME='Csector' ONCHANGE='SECTORCHANGED()'>"
bodystring = bodystring & "<option value='0'> </option>"
bodystring = bodystring & "<option value='ES'"
而不是内联If
s