vb中的控件类型如pnl,auj等等都是啥意思

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vb中的控件类型如pnl,auj等等都是啥意思相关的知识,希望对你有一定的参考价值。

参考技术A 本来是一个表格,但是百度知道忽略空格,也没啥办法,将就着看吧。
===========================
控件类型 前缀 例子
3D Panel pnl pnlGroup
ADO Data ado adoBiblio
Animated button ani aniMailBox
Check box chk chkReadOnly
Combo box, drop-down list box cbo cboEnglish
Command button cmd cmdExit
Common dialog dlg dlgFileOpen
Communications com comFax
Control (当特定类型未知时,在过程中所使用的) ctr ctrCurrent
Data dat datBiblio
Data-bound combo box dbcbo dbcboLanguage
Data-bound grid dbgrd dbgrdQueryResult
Data-bound list box dblst dblstJobType
Data combo dbc dbcAuthor
Data grid dgd dgdTitles
Data list dbl dblPublisher
Data repeater drp drpLocation
Date picker dtp dtpPublished
Directory list box dir dirSource
Drive list box drv drvTarget
File list box fil filSource
Flat scroll bar fsb fsbMove
Form frm frmEntry
Frame fra fraLanguage
Gauge gau gauStatus
Graph gra graRevenue
Grid grd grdPrices
Hierarchical flexgrid flex flexOrders
Horizontal scroll bar hsb hsbVolume
Image img imgIcon
Image combo imgcbo imgcboProduct
ImageList ils ilsAllIcons
Label lbl lblHelpMessage
Lightweight check box lwchk lwchkArchive
Lightweight combo box lwcbo lwcboGerman
Lightweight command button lwcmd lwcmdRemove
Lightweight frame lwfra lwfraSaveOptions
Lightweight horizontal scroll bar lwhsb lwhsbVolume
Lightweight list box lwlst lwlstCostCenters
Lightweight option button lwopt lwoptIncomeLevel
Lightweight text box lwtxt lwoptStreet
Lightweight vertical scroll bar lwvsb lwvsbYear
Line lin linVertical
List box lst lstPolicyCodes
ListView lvw lvwHeadings
MAPI message mpm mpmSentMessage
MAPI session mps mpsSession
MCI mci mciVideo
Menu mnu mnuFileOpen
Month view mvw mvwPeriod
MS Chart ch chSalesbyRegion
MS Flex grid msg msgClients
MS Tab mst mstFirst
OLE container ole oleWorksheet
Option button opt optGender
Picture box pic picVGA
Picture clip clp clpToolbar
ProgressBar prg prgLoadFile
Remote Data rd rdTitles
RichTextBox rtf rtfReport
Shape shp shpCircle
Slider sld sldScale
Spin spn spnPages
StatusBar sta staDateTime
SysInfo sys sysMonitor
TabStrip tab tabOptions
Text box txt txtLastName
Timer tmr tmrAlarm
Toolbar tlb tlbActions
TreeView tre treOrganization
UpDown upd updDirection
Vertical scroll bar vsb vsbRate本回答被提问者采纳

C#/VB.NET 获取Excel中的表单控件

Excel中可通过【开发工具】菜单栏下插入表单控件,如文本框、单选按钮、复选框、组合框等等,插入后的控件可执行设置控件格式,如大小、是否锁定、位置、可选文字、数据源区域、单元格链接等。当Excel中已插入上述控件,需要读取时,也可以使用本文中的方法来读取。下面,将通过C#及VB.NET代码示例展示如何来获取Excel文档中的表单控件。以下是读取的方法及步骤,供参考。


【引用dll】

方法1:在程序中手动引入Spire.Xls.dll文件;将Free Spire.XLS for .NET下载到本地,解压,安装。安装完成后,找到安装路径下BIN文件夹中的Spire.Xls.dll。然后在Visual Studio中打开“解决方案资源管理器”,鼠标右键点击“引用”,“添加引用”,将本地路径BIN文件夹下的dll文件添加引用至程序。

方法2:通过​​NuGet​​安装。可通过以下2种方法安装:

(1)可以在Visual Studio中打开“解决方案资源管理器”,鼠标右键点击“引用”,“管理NuGet包”,然后搜索“Free Spire.XLS”,点击“安装”。等待程序安装完成。

(2)将以下内容复制到PM控制台安装。

Install-Package FreeSpire.XLS -Version 12.2.0


【代码示例】

C#

using System;
using Spire.Xls;
using Spire.Xls.Core;

namespace GetFormControl

class Program

static void Main(string[] args)

//创建Workbook类的实例,加载Excel文档
Workbook wb = new Workbook();
wb.LoadFromFile("test.xlsx");

//获取第1张工作表
Worksheet sheet = wb.Worksheets[0];

//获取TextBox
string textbox = sheet.TextBoxes[0].Text;
Console.WriteLine("TextBox: "+ textbox);
Console.ReadLine();

//获取Radio Button
for (int i = 0; i < sheet.RadioButtons.Count; i++)

IRadioButton radioButton = sheet.RadioButtons[i];
string name = radioButton.CheckState.ToString();
string text = radioButton.Text;
bool islocked = radioButton.IsLocked;
Console.WriteLine("RadioButtons: " + name + text + " 是否锁定:" + islocked.ToString());
Console.ReadLine();


//获取Combo Box控件中的选中的值(注:非列表中所有选项值)
string value = sheet.ComboBoxes[0].SelectedValue;
Console.WriteLine("ComboBoxes: " + value);
Console.ReadLine();

//获取Checkbox
for (int z = 0; z < sheet.CheckBoxes.Count; z++)

ICheckBox checkBox = sheet.CheckBoxes[z];
string text = checkBox.Text;
string name = checkBox.CheckState.ToString();
string alternativetext = checkBox.AlternativeText;
Console.WriteLine("CheckBoxes: " + text + name + alternativetext);
Console.ReadLine();


//获取SpinnerShape
for (int j = 0; j < sheet.SpinnerShapes.Count; j++)

ISpinnerShape spinnerShape = sheet.SpinnerShapes[j];
string rangeAddress = spinnerShape.LinkedCell.RangeAddress;
int currentValue = spinnerShape.CurrentValue;
Console.WriteLine("SpinnerShapes: RangeAddress is " + rangeAddress + "\\n"+"CurrentValue:" + currentValue);
Console.ReadLine();




vb.net

Imports Spire.Xls
Imports Spire.Xls.Core

Namespace GetFormControl
Class Program
Private Shared Sub Main(args As String())
创建Workbook类的实例,加载Excel文档
Dim wb As New Workbook()
wb.LoadFromFile("AddControls.xlsx")

获取第1张工作表
Dim sheet As Worksheet = wb.Worksheets(0)

获取TextBox
Dim textbox As String = sheet.TextBoxes(0).Text
Console.WriteLine(Convert.ToString("TextBox: ") & textbox)
Console.ReadLine()

获取Radio Button
For i As Integer = 0 To sheet.RadioButtons.Count - 1
Dim radioButton As IRadioButton = sheet.RadioButtons(i)
Dim name As String = radioButton.CheckState.ToString()
Dim text As String = radioButton.Text
Dim islocked As Boolean = radioButton.IsLocked
Console.WriteLine((Convert.ToString(Convert.ToString("RadioButtons: ") & name) & text) + " 是否锁定:" + islocked.ToString())
Console.ReadLine()
Next

获取Combo Box控件中的选中的值(注:非列表中所有选项值)
Dim value As String = sheet.ComboBoxes(0).SelectedValue
Console.WriteLine(Convert.ToString("ComboBoxes: ") & value)
Console.ReadLine()

获取Checkbox
For z As Integer = 0 To sheet.CheckBoxes.Count - 1
Dim checkBox As ICheckBox = sheet.CheckBoxes(z)
Dim text As String = checkBox.Text
Dim name As String = checkBox.CheckState.ToString()
Dim alternativetext As String = checkBox.AlternativeText
Console.WriteLine(Convert.ToString(Convert.ToString(Convert.ToString("CheckBoxes: ") & text) & name) & alternativetext)
Console.ReadLine()
Next

获取SpinnerShape
For j As Integer = 0 To sheet.SpinnerShapes.Count - 1
Dim spinnerShape As ISpinnerShape = sheet.SpinnerShapes(j)
Dim rangeAddress As String = spinnerShape.LinkedCell.RangeAddress
Dim currentValue As Integer = spinnerShape.CurrentValue
Console.WriteLine((Convert.ToString("SpinnerShapes: RangeAddress is ") & rangeAddress) + vbLf + "CurrentValue:" + currentValue)
Console.ReadLine()
Next

End Sub
End Class
End Namespace

控件读取效果:

C#/VB.NET

C#/VB.NET


—END—

以上是关于vb中的控件类型如pnl,auj等等都是啥意思的主要内容,如果未能解决你的问题,请参考以下文章

VB定时器控件Interval属性设置为0是啥意思

英语翻译property在这里是啥意思

VB定时器控件Interval属性设置为0是啥意思?

如何在 VB.Net 中正确地从内存中删除控件? [复制]

VB中的list控件是啥?

C#/VB.NET 获取Excel中的表单控件