Richedit1.SelAttributes.Name:='宋体'
else if ComboBox1.Text='微软雅黑'then
Richedit1.SelAttributes.Name:='微软雅黑'
else if ComboBox1.Text='楷体'then
Richedit1.SelAttributes.Name:='楷体'
else if ComboBox1.Text='幼圆'then
Richedit1.SelAttributes.Name:='幼圆'
else if ComboBox1.Text='喵呜体'then
Richedit1.SelAttributes.Name:='喵呜体'
else if ComboBox1.Text='黑体'then
Richedit1.SelAttributes.Name:='黑体'
else
Richedit1.SelAttributes.Name:='宋体'
combobox1.text获取前选择值 我段代码做类似于WORD程序设置字体用参照
另外拉框值combobox属性items设置
在Combo1的下拉事件中加入代码,如下:Private Sub combo1_DropDown()
Me.combo1.Clear
Dim CN As New ADODB.Connection
CN.Open"Provider=microsoft.jet.oledb.4.0data source=" &App.Path &"\数据库名称.mdb"
DimJ As Integer
DimST As String
Dimrso As ADODB.Recordset
Setrso = New ADODB.Recordset
ST= "select * from 表名"
rso.Open ST, CN, adOpenKeyset, adLockOptimistic
IfNot rso.EOF Then
rso.MoveFirst
End If
ForJ = 1 To rso.RecordCount
Me.combo1.AddItem rso("字段名")
rso.MoveNext
NextJ
rso.Close
Set CN = Nothing
End sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)