如何基于选项卡页面标签值选择一个选项卡
我有一个SyncFusion选项卡控件,并且根据用户的帐户数量填充它们的选项卡。
foreach (SecurityAccount securityAccount in secs)
{
string name = securityAccount.AccountNumber;
Syncfusion.Windows.Forms.Tools.TabPageAdv tabPage =
new Syncfusion.Windows.Forms.Tools.TabPageAdv(securityAccount.PortfolioName
+ " [" + securityAccount.AccountNumber + "]");
tabPage.Tag = securityAccount.AccountNumber;
tcAcc.TabPages.Add(tabPage);
if (securityAccount.IsDefaultPortfolio)
defaultPortfolioName = securityAccount.AccountNumber;
}
在每个安全帐户中,都有一个名为isDefaultPortFolio
帐户的字段或一个字段。 因此,如果是默认值,我将该值放在DefaultPortFolioname参数中 因此,现在我想选择具有此安全帐户号的TABPAGE(将其放入TabPage.tag值中。
我写了这本书,
tcAcc.SelectedIndex = tcAcc.TabPages.IndexOf(defaultPortfolioName);
但这无效,因为我不是说要检查每个选项卡的标签值。
I have a syncfusion tab control and their Tabs are populated according to the number of accounts a user has.
foreach (SecurityAccount securityAccount in secs)
{
string name = securityAccount.AccountNumber;
Syncfusion.Windows.Forms.Tools.TabPageAdv tabPage =
new Syncfusion.Windows.Forms.Tools.TabPageAdv(securityAccount.PortfolioName
+ " [" + securityAccount.AccountNumber + "]");
tabPage.Tag = securityAccount.AccountNumber;
tcAcc.TabPages.Add(tabPage);
if (securityAccount.IsDefaultPortfolio)
defaultPortfolioName = securityAccount.AccountNumber;
}
In every security account, there is a field called IsDefaultPortfolio
Account or a not.
so if it is a default one I am putting that value in the defaultPortfolioName parameter
So now I want to select the tabpage that has this security account number (Which is put into tabPage.Tag value.
I wrote this
tcAcc.SelectedIndex = tcAcc.TabPages.IndexOf(defaultPortfolioName);
But that doesn't work because I am not saying to check the Tag value of each tab.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据每个卡普普的标签中存储的值选择选项卡。
Select the tabpage based on the value stored in the tag of each tabpage.