**根据楼主的思路简化了一下(仅供参考)
******************* 测试参数,测试时打开
*clear
* msg1="人类的认知极限,远距离超过 10的23次方_米,就很难达到了。在170亿年前,"+0h0A
* msg2="空间和时间都不存在,没有太阳、月亮和星星。突然,一个神秘的奇点爆发了!"+0h0A
* msg3="天地万物开始产生。随后,我们也来了。神秘的巨大爆发,直到今天还在进行,"+0h0a
* msg4="对外速度越来越快,我们却正在生活在其中 ..."
* msg=msg1+msg2+msg3+msg4
* cr=2
* msgt='提示:'
* msgc='chek11'
* col1=RGB(240,240,240)
* col2=RGB(0,0,250)
* col3=RGB(255,255,255)
* col4=RGB(0,128,0)
* dfmsg(msg,cr,msgt,msgc,col1,col2,col3,col4)
*?tmp_5
*return
****************
PROCEDURE dfmsg && 检查函数的输入数据,并定义默认值
LPARAMETERS msg,cr,msgt,msgc,col1,col2,col3,col4
LOCAL ARRAY tmp_1(1)
LOCAL tmp_2,tmp_3,tmp_4
PUBLIC tmp_5
msg=ICASE(Type('msg')$'N',ALLTRIM(STR(msg)),Type('msg')$'L','',Type('msg')$'D' or Type('msg')$'T',ttoc(msg),ALLTRIM(msg))
cr=ICASE(varType(cr)#'N',0,cr)
msgt=ICASE(TYPE('msgt')$'N',ALLTRIM(str(msgt)),TYPE('msgt')$'L','',Type('msgt')$'D' or Type('msgt')$'T',ttoc(msgt),ALLTRIM(msgt))
msgc=ICASE(TYPE('msgc')$'N',ALLTRIM(str(msgc)),TYPE('msgc')$'L','',Type('msgc')$'D' or Type('msgc')$'T',ttoc(msgc),ALLTRIM(msgc))
col1=IIF(TYPE("col1")#'N',ICASE(TYPE("f_color_01")#'N',f_color_01,14215660),col1)
col2=IIF(TYPE("col2")#'N',ICASE(TYPE("f_color_02")#'N',f_color_02,0),col2)
col3=IIF(TYPE("col3")#'N',ICASE(TYPE("f_color_01")#'N',f_color_01,14215660),col3)
col4=IIF(TYPE("col4")#'N',ICASE(TYPE("f_color_02")#'N',f_color_02,0),col4)
store 0 to tmp_1,tmp_2 && 定义行数,最大宽度
tmp_2=alines(tmp_1,msg)
tmp_3=0
FOR EACH tmp_4 IN tmp_1
tmp_3 = MAX(tmp_3,LEN(tmp_4))
ENDFOR
tmp_3=ICASE(LEN(msgc)<>0,MAX(tmp_3,LEN(msgc)),tmp_3) && 最大长度
tmp_4=ICASE(LEN(msgc)=0,0,1)
tmp_3=ICASE(tmp_3>10,tmp_3-10,0)
tmp_5=0
oForm = CREATEOBJECT("cForm",tmp_2,tmp_3)
tmp_5=tmp_2
oForm.Show
* READ EVENTS && 测试时要关闭,编译时不能关
ENDFUNC
*****************************************
DEFINE CLASS cForm AS Form && 定义表单
Closable = .F.
Height = 80+(tmp_2+tmp_4)*FONTMETRIC(1)
Width = 100 +tmp_3*FONTMETRIC(6)
backcolor=col1
AutoCenter = .T.
BorderStyle = 2
Caption = msgt
FontCondense = .T.
MaxButton = .F.
MinButton = .F.
WindowType = 1
AlwaysOnTop = .T.
ADD object lb1 as label with wordrap=.t.,BackStyle=0,forecolor=col2,Caption=msg,Left=30,;
Top = 25,Height=(tmp_2+tmp_4)*FONTMETRIC(1),Width = LEN(msg)*FONTMETRIC(6)
ADD object chk as checkbox with AutoSize=.T.,BackStyle=0,forecolor=col2,Caption=msgc,;
Top=35+tmp_2*FONTMETRIC(1),Left=30,Height=16,Width=20+LEN(msgc)*FONTMETRIC(6)
ADD object cmd1 as commandbutton with backcolor=col3,forecolor=col4,Top=40+(tmp_2+tmp_4)*FONTMETRIC(1),;
Left=(40+tmp_3*FONTMETRIC(6))/3,Height = 20,Width=30,Caption = "是"
ADD object cmd2 as commandbutton with backcolor=col3,forecolor=col4,Top=40+(tmp_2+tmp_4)*FONTMETRIC(1),;
Left=(40+tmp_3*FONTMETRIC(6))/3*2+30,Height=20,Width=30,caption="否"
procedure init
lparameters tmp_2,tmp_3
IF LEN(msgc)>0
this.chk.visible=.t.
this.cmd1.enabled=.f.
ENDIF
cm1=ICASE(cr=0,'this.cmd1.left=(70+tmp_3*FONTMETRIC(6))/2',cr=2,'this.cmd1.caption="确定"','')
&cm1
cm2=ICASE(cr=0,'this.cmd1.visible=.t.',cr=2,'this.cmd2.caption="取消"','')
&cm2
endproc
procedure chk.click
this.parent.cmd1.enabled=this.Value
endpro
procedure cmd1.click
tmp_5=1
thisform.Release()
clear events
endproc
procedure cmd2.click
thisform.Release()
clear events
endproc
ENDDEFINE
******************* 测试参数,测试时打开
*clear
* msg1="人类的认知极限,远距离超过 10的23次方_米,就很难达到了。在170亿年前,"+0h0A
* msg2="空间和时间都不存在,没有太阳、月亮和星星。突然,一个神秘的奇点爆发了!"+0h0A
* msg3="天地万物开始产生。随后,我们也来了。神秘的巨大爆发,直到今天还在进行,"+0h0a
* msg4="对外速度越来越快,我们却正在生活在其中 ..."
* msg=msg1+msg2+msg3+msg4
* cr=2
* msgt='提示:'
* msgc='chek11'
* col1=RGB(240,240,240)
* col2=RGB(0,0,250)
* col3=RGB(255,255,255)
* col4=RGB(0,128,0)
* dfmsg(msg,cr,msgt,msgc,col1,col2,col3,col4)
*?tmp_5
*return
****************
PROCEDURE dfmsg && 检查函数的输入数据,并定义默认值
LPARAMETERS msg,cr,msgt,msgc,col1,col2,col3,col4
LOCAL ARRAY tmp_1(1)
LOCAL tmp_2,tmp_3,tmp_4
PUBLIC tmp_5
msg=ICASE(Type('msg')$'N',ALLTRIM(STR(msg)),Type('msg')$'L','',Type('msg')$'D' or Type('msg')$'T',ttoc(msg),ALLTRIM(msg))
cr=ICASE(varType(cr)#'N',0,cr)
msgt=ICASE(TYPE('msgt')$'N',ALLTRIM(str(msgt)),TYPE('msgt')$'L','',Type('msgt')$'D' or Type('msgt')$'T',ttoc(msgt),ALLTRIM(msgt))
msgc=ICASE(TYPE('msgc')$'N',ALLTRIM(str(msgc)),TYPE('msgc')$'L','',Type('msgc')$'D' or Type('msgc')$'T',ttoc(msgc),ALLTRIM(msgc))
col1=IIF(TYPE("col1")#'N',ICASE(TYPE("f_color_01")#'N',f_color_01,14215660),col1)
col2=IIF(TYPE("col2")#'N',ICASE(TYPE("f_color_02")#'N',f_color_02,0),col2)
col3=IIF(TYPE("col3")#'N',ICASE(TYPE("f_color_01")#'N',f_color_01,14215660),col3)
col4=IIF(TYPE("col4")#'N',ICASE(TYPE("f_color_02")#'N',f_color_02,0),col4)
store 0 to tmp_1,tmp_2 && 定义行数,最大宽度
tmp_2=alines(tmp_1,msg)
tmp_3=0
FOR EACH tmp_4 IN tmp_1
tmp_3 = MAX(tmp_3,LEN(tmp_4))
ENDFOR
tmp_3=ICASE(LEN(msgc)<>0,MAX(tmp_3,LEN(msgc)),tmp_3) && 最大长度
tmp_4=ICASE(LEN(msgc)=0,0,1)
tmp_3=ICASE(tmp_3>10,tmp_3-10,0)
tmp_5=0
oForm = CREATEOBJECT("cForm",tmp_2,tmp_3)
tmp_5=tmp_2
oForm.Show
* READ EVENTS && 测试时要关闭,编译时不能关
ENDFUNC
*****************************************
DEFINE CLASS cForm AS Form && 定义表单
Closable = .F.
Height = 80+(tmp_2+tmp_4)*FONTMETRIC(1)
Width = 100 +tmp_3*FONTMETRIC(6)
backcolor=col1
AutoCenter = .T.
BorderStyle = 2
Caption = msgt
FontCondense = .T.
MaxButton = .F.
MinButton = .F.
WindowType = 1
AlwaysOnTop = .T.
ADD object lb1 as label with wordrap=.t.,BackStyle=0,forecolor=col2,Caption=msg,Left=30,;
Top = 25,Height=(tmp_2+tmp_4)*FONTMETRIC(1),Width = LEN(msg)*FONTMETRIC(6)
ADD object chk as checkbox with AutoSize=.T.,BackStyle=0,forecolor=col2,Caption=msgc,;
Top=35+tmp_2*FONTMETRIC(1),Left=30,Height=16,Width=20+LEN(msgc)*FONTMETRIC(6)
ADD object cmd1 as commandbutton with backcolor=col3,forecolor=col4,Top=40+(tmp_2+tmp_4)*FONTMETRIC(1),;
Left=(40+tmp_3*FONTMETRIC(6))/3,Height = 20,Width=30,Caption = "是"
ADD object cmd2 as commandbutton with backcolor=col3,forecolor=col4,Top=40+(tmp_2+tmp_4)*FONTMETRIC(1),;
Left=(40+tmp_3*FONTMETRIC(6))/3*2+30,Height=20,Width=30,caption="否"
procedure init
lparameters tmp_2,tmp_3
IF LEN(msgc)>0
this.chk.visible=.t.
this.cmd1.enabled=.f.
ENDIF
cm1=ICASE(cr=0,'this.cmd1.left=(70+tmp_3*FONTMETRIC(6))/2',cr=2,'this.cmd1.caption="确定"','')
&cm1
cm2=ICASE(cr=0,'this.cmd1.visible=.t.',cr=2,'this.cmd2.caption="取消"','')
&cm2
endproc
procedure chk.click
this.parent.cmd1.enabled=this.Value
endpro
procedure cmd1.click
tmp_5=1
thisform.Release()
clear events
endproc
procedure cmd2.click
thisform.Release()
clear events
endproc
ENDDEFINE