2012-01-09 59 views
0

我想用刺在gridcode如何使用字符串正確

代碼

Dim View as string 
View = "Rajan & vbtab & 211" 
With gridview 
.AddItem View 
End with 

' 輸出(FlexGrid的)

Name Value 

`Rajan & vbtab & 211` 

' 這是顯示名稱列,它應該在值列中顯示Rajan的名稱列中的211。

我的代碼有什麼問題。

預期輸出(FlexGrid的)

Name Value 

Rajan 211 

需要代碼幫助

回答

4

vbtab是你沒有正確關閉您的報價關鍵字..

Dim View as string 
View = "Rajan" & vbtab & "211" 
With gridview 
.AddItem View 
End with 

上面的代碼應該工作。

+0

我想給vbtab也在字符串中,因爲我有50列的數量,所以我不能夠輸入50次vbtab,你能不能幫我... – Gopal 2012-01-09 07:31:40

+0

你不能在字符串中給出'vbtab',你將不得不連接是否正確 – Murtaza 2012-01-09 07:34:44

+0

&opeator,那麼我是否必須用雙引號給出......或者? – Gopal 2012-01-09 07:36:29