你在text2_change事件中的代码是如何写的?

解决方案 »

  1.   

    这个好象用处不大,都是pagemaker的scripting
    Private Sub Text2_Change()
    If Flag <> 1 Then
        Call link
    End If
    color_d = "definecolor " & Chr(34) & "Text_clr2" & Chr(34) & ",spot,rgb255,false," & text_red(2) & "," & text_green(2) & "," & text_blue(2)
        txtlink.LinkExecute (color_d)
        txtlink.LinkExecute ("deletelayer " & Chr(34) & "layer_text2" & Chr(34))
        comm = "newlayer " & Chr(34) & "layer_text2" & Chr(34) & ",1,0,0," & text_red(2) & "," & text_green(2) & "," & text_blue(2)
        txtlink.LinkExecute (comm)
    '    co = "newstorysized 400,0,570,50" '& Px & "," & Py & "," & Px + 200 & "," & Py + 200
        co = "newstorysized 10,100,200,150"
        txtlink.LinkExecute (co)
        Text_content = "textenter " & Chr(34) & Text2.Text & Chr(34)
        txtlink.LinkExecute (Text_content)
        txtlink.LinkExecute ("stylebegin " & Chr(34) & "text2" & Chr(34))
        txtlink.LinkExecute ("font " & Chr(34) & text_font(2) & Chr(34))
        txtlink.LinkExecute ("color " & Chr(34) & "Text_clr2" & Chr(34))
        txtlink.LinkExecute ("size " & f_fontsize(2))
        If f_fontbold(2) Then
            txtlink.LinkExecute ("typestyle bold")
        End If
        If f_fontitalic(2) Then
            txtlink.LinkExecute ("typestyle italic")
        End If
    End Sub
      

  2.   

    做一下判断呀:
    Private Sub Text2_Change()
    If len(Text2.Text)=n then
      ......
    else
      .....
    end if
    end sub
      

  3.   

    比如设n=3 然后打“中华人民共和国”,只能出来“中华人”则触发change,然后截断整个词组了
      

  4.   

    Private Sub Text2_Change()
    If right(Text2.Text,1)=chr(13) then
      ......
    else
      .....
    end if
    end sub
      

  5.   

    你不用change事件,用text_keyPress事件不好吗?
    private sub text_keypress(keyascii as integer)
       if keyascii=13 then
          ............   
       end if
    end sub
      

  6.   

    同意楼上~~~不过既然这样。建议用Keydown 事件
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    if keycode=13 then
    ...........
    else
    ...........
    endif
    End Sub
      

  7.   

    为什么我这里能触发change事件呢???????
      

  8.   

    用keydown 和keypress都可以同步呀,你们老板起码告诉你是什么时候开始执行所要的同步事件吧?我觉得你主要是自己都还不太清楚什么时候要促发文本变化事件,你本来就想不止一次的输入,其实就不是同步了,呵呵,用keydown 和keypress绝对可以达到目的的,就用回车做输入结束标志,再判断文本和以前文本的异同就可以了
      

  9.   

    Private Sub Text1_Change()
    Text2.Text = Text1.Text
    Label1.Caption = Text2.Text
    End Sub
    这种方法不行吗?我怎么都可以的啊?如果这样可以的话,那相类似的问题怎么不行呢?