cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Flickering

Former Member
0 Kudos

I have a SDK form, with many folder items on it ('tabs').

Plus a matrix component, with many columns bound to user datasources.

SBO version is 2007.

I notice that when i set the values of the datasources with.ValueEx the screen (and most notably the folderitems) start to redraw, causing lots of flicker when there are many columns. I did some testing and it very specifically occurs on the setting of .ValueEx , without even calling .SetLineData on the matrix.

This behaviour was not present in SBO2005.

Anyone else noticing this behaviour or knows the cause?

A remedy that works is to wrap everything always in a Freeze/Unfreeze of the form, which reduces the flickering in a one time flicker. This is not a nice solution, since actually nothing should even be redrawn yet, until the .SetLineData of the matrix.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I guess using Form Freez and Unfreez is the only solution.

Vasu Natari.

Answers (1)

Answers (1)

Former Member
0 Kudos

Use form.freeze for this. The next thing which often helpsd is using progressbar as

Dim oProgBarx As SAPbouiCOM.ProgressBar

oProgBarx = SBO_Application.StatusBar.CreateProgressBar("loading...", 1000, True)

oProgBarx.Stop()

System.Runtime.InteropServices.Marshal.ReleaseComObject(oProgBarx)

oProgBarx = Nothing

Im doing it so:

freeze the form, add new item to the form (load form from xml is faster than creating by item) and then unfreeze the form. When user change panelevel (click on folder), I fill proper item (when they are not bounded to datasource) - if the item is bounded to datasource, there is no flickering.

Sometimes the flickering occurs when you are using formatted search on some editboxes...

Former Member
0 Kudos

This phenomenon does not occur during form loading, etc, it very specifically is after setting the .ValueEx property of a userdatasource bounded to a matrix column.

Which does not make much sense since nothing should be (re)displayed then.

I preferably do not want to litter my code with Freeze/Unfreeze everywhere...

Former Member
0 Kudos

Hi ,

Use

Form.Freeze(True)

//Ur Code here

Form.Freeze(False)

Form.Update() //which redraws the form

I hope this will help u

Regards

Mohana

Former Member
0 Kudos

Hmm, I think that only way is use freezing form or try to unbind the datasource from matrix, set values and bind it again.

Otherwise, I dont have any other ideas.

Former Member
0 Kudos

Hi RP de Boer,

Usually that is due to chained Form.Freeze(True), Form.Freeze(False).

Example:


Private Sub myMainSub()
   Form.Freeze(True)
     mySub1()
     mySub2()
   Form.Freeze(False)
End Sub

Private Sub mySub1()
   Form.Freeze(True)
   SubXPTO()
   Form.Freeze(False)
End Sub

Private Sub mySub2()
   Form.Freeze(True)
   '// Do something...
   Form.Freeze(False)
End Sub

Private Sub SubXPTO()
   Form.Freeze(True)
   '// Do something...
   Form.Freeze(False)
End Sub

You need to remember that the form flicker when you use Form.Freeze(False).

Regards,

Vítor Vieira

Former Member
0 Kudos

the unfreeze comment is a good tip, although i hoped that the command would be smarter (doing a count of open freeze(true) commands for instance) and only redraw on count = 0.

but i did some xperiments and noticed that is specifically happens at setting the datasource value.

for instance:

columndatasource1.valueex = "value";

sleep (200);

columndatasource2.valueex = "value";

sleep (200);

columndatasource3.valueex = "value";

sleep (200);

columndatasource4.valueex = "value";

sleep (200);

columndatasource5.valueex = "value";

sleep (200);

columndatasource6.valueex = "value";

sleep (200);

will show 6 very clear redraws of the form and very clearly of the folder buttons.

I never noticed it in 2005, but now in 2007.

Try it!

Former Member
0 Kudos

RP de Boer,

You are using UserDataSources, correct?

I use DBDataSources and I don't get any flickering when I set the values...

Regards,

Vítor Vieira

Former Member
0 Kudos

correct, a matrix with user datasources connected to the columns.

Former Member
0 Kudos

RP de Boer,

From the SDK help file


Description
     Returns or sets a value in the data source in database format only.

Property type
     Read-write property
Syntax
     Visual Basic 
          Public Property ValueEx() As String
 
Return Type
     The property returns an exceptions if the entered value is not in the accepted format. 

Remarks
     Acceptable format for dt_MEASURE, dt_PERCENT, dt_PRICE, dt_QUANTITY, and dt_RATE:
     xxx.yyy

     Acceptable format for dt_DATE:
     yyyymmdd - year in four characters, month in two characters, day in two characters.

     Changing the machine regional settings does not affect the acceptable format.

This method triggers some kind of validation. I guess it's this validation that causes the flickering in the form.

I suggest you post support message in the partner portal. It could be a bug.

Regards,

Vítor Vieira