Assign event to memoview at runtime using VB6
keturpatel
India
I'm trying to add event to memoview at runtime, but cannot find way to assign event.
I'm using VB6 and creating report at runtime with several memoviews.
I have added script to report object, which has some variables and procedures.
Now i want to assign one of script procedure to obp event of memoview in report.
but cant find way to do so. my fastreport version is 4.9
Here is sample vb6 code i am using :
Here in above code,
I want to assign Procedure MemoView1OnBeforePrint as event handler for MemoView1's OnBeforePrint
I need something like MyMemoview.EventHandler.OnBeforePrint = "MemoView1OnBeforePrint"
Please help me.
Thanks in advance.
I'm using VB6 and creating report at runtime with several memoviews.
I have added script to report object, which has some variables and procedures.
Now i want to assign one of script procedure to obp event of memoview in report.
but cant find way to do so. my fastreport version is 4.9
Here is sample vb6 code i am using :
    sTemp = "var  xTotDay :Double;" & vbCrLf & vbCrLf & _
            "procedure MemoView1OnBeforePrint(Sender: TfrxComponent);" & vbCrLf & _
            "begin" & vbCrLf & _
            "    xTotDay := 1234;
            "    MemoView1.Text := FormatFloat('0.00',xTotDay);" & vbCrLf & _
            "end;" & vbCrLf & vbCrLf & _
            "begin" & vbCrLf & _
            "" & vbCrLf & _
            "end."
    MyTfrxReport.Script.ClearScript
    MyTfrxReport.ScriptLanguage = "PascalScript"
    MyTfrxReport.ScriptText = sTemp
Here in above code,
I want to assign Procedure MemoView1OnBeforePrint as event handler for MemoView1's OnBeforePrint
I need something like MyMemoview.EventHandler.OnBeforePrint = "MemoView1OnBeforePrint"
Please help me.
Thanks in advance.
Comments
Not yet.