以下是可以直接运行的代码,请试用。 需要注意的是,Array函数给arr数组赋值后,arr数组的下界是0,而不是1,可以用Lbound(arr)检测。如果在For...Next循逗慎环中从1开始循环,当所要查找的字符正好是arr(0)时,则会漏掉。相应的,如果发现有字符匹配,则数组中应该是第i+1个元素与目标字符串匹配。 不知以上的说明是否清楚,希望对你有所帮助。弯岩 Sub stringMatch() Dim arr As Variant Dim i As Integer, s As String Dim matchLabel As Boolean
能请看例句1. This phrase is labelled as an Americanism in this dictionary. 这本词典把这个短语称为美国特有的语言现象。来自《简明英汉词典》 2. The phrase is labelled as slang in the dictionary. 这个短语在孝竖激这本字巧袜典里被注为俚语。 来自《简明英汉词典》 3. Everything may be labelled, but everybody is not. 样样东西都可以贴标签,可就是没有给人贴标签纤陵的。 来自《简明英汉词典》 4. His enemies labelled the boy a thief. 他的敌人把这个小孩叫做小偷。 来自《简明英汉词典》 5. His son and daughter are clever that everyone labelled them as the genius. 他儿子和女儿都非常聪明,大伙都称他们是天才。 来自《简明英汉词典》
用控件数组是一个方法。如果真的要动态加载控件和代码劝放弃,那不可能达到尽善尽美的,有很多复杂的问题。 这里有段我当年的类代码: Option Explicit Private WithEvents NewButton As CommandButton Private WithEvents NewText As TextBox Private WithEvents NewLabel As Label Private WithEvents NewPicture As PictureBox Public Function AddButton(按扭名称 As String, 按扭横坐标 As Long, 按扭纵坐标 As Long, 目标窗体名称) ’If NewButton Is Nothing Then Set NewButton = 目标窗体名称.Controls.Add("VB.CommandButton", 按扭名称, 目标窗体名称) NewButton.Move 按扭横坐标, 按扭纵坐标 NewButton.Caption = "添加的按钮" NewButton.Visible = True ’End If End Function Public Function AddText(文本框名称 As String, 文本框横坐标 As Long, 文本框纵坐标 As Long, 目标窗体名称) If NewText Is Nothing Then Set NewText = 目标窗体名称.Controls.Add("VB.TextBox", 文本框名称, 目标窗贺闭扰体名称) NewText.Move 文本框横坐标, 文本框纵坐标 NewText.Text = "添加的文本框" NewText.Visible = True End If End Function Public Function AddLabel(标签名称 As String, 标签横坐标 As Long, 标签纵坐标 As Long, 目标窗体名称) If NewLabel Is Nothing Then Set NewLabel = 目标窗体名称.Controls.Add("VB.Label"禅旦, 标签名称, 目标窗体名称) NewLabel.Move 标签横坐标, 标签纵坐标 NewLabel.Caption = "添态裤加的标签" NewLabel.Visible = True End If End Function Public Function AddPictureBox(图片名称 As String, 图片横坐标 As Long, 图片纵坐标 As Long, 目标窗体名称) If NewPicture Is Nothing Then Set NewPicture = 目标窗体名称.Controls.Add("VB.PictureBox", 图片名称, 目标窗体名称) NewPicture.Move 图片横坐标, 图片纵坐标 NewPicture.Visible = True End If End Function
1我们可以做这个label像第一次一样宴毁链,并且根绝第二次样品的颜色。 (1)We can make the same label as the one made for the first time ,what’s more, the color is also the same with the second sample. (2) We can produce the label which is the same as the one made for the first time, In additon to that, The color will be made to be the same with that of the second sample (3) We are able to make the label whose appearance is the same as that made for the first time, additionally, The color will be the same with that of the second sample. 2.根据第一次样品的做法也可以做折线。 (1)Broken line can be also made according to the approach(method) of the first sample (2)Polygonal line can be also produced based on the method of the first sample (3)Dog-leg path can be practicable in accordance with the technique of your first sample (4)Fold line will be made available by adopting the method of your first sample 3,关于这个Mesh backing ,需要你提供样品给我们。我们会根据你样品重新调整价格。晌孙 (1)As for the Mesh backing, You are suggested to offer us the sample and re-adjusted price will be afforded according to your sample. (2) As regards Mesh backing, We need you to provide us with the sample and we will re-adjust the price according to your offered sample (3) With regard to Mesh backing, We require you to send us the sample and we will adjust the price again based on the sample you give us (4) As far as Mesch backing is concerned , We want you to offer us the sample and readjusted price will be given in accordance with your offered sample. 纯人工翻译,满余此意请立即采纳,谢谢!
补液游充一下,对象变量属引用型变量,不能象普通数据类型一样定义一下就可使用了。 还的把变量与某个对象实例建立关联才可使用,如: dim cnt as Control set cnt = text1 这是把 cnt 变量 与窗体上已存在的文运唯本框控件关联。 如果是新建闹悄销一个控件的话,照网海1书生的做。