Click here to Skip to main content
15,443,630 members

Comments by Daniele Rota Nodari (Top 44 by date)

Daniele Rota Nodari 1-Aug-22 6:57am View     CRLF
What method does the "relevant code" come from? Why are you hiding/showing child controls if the triggering event is a parent window restore (that should not affect children layout and visibility)? Have IsAppRunning anything to do with the TextBox/RichTextBox swap logic or the minimize/restore events (maybe you wanted to check for IsHandleCreated and Disposing/IsDisposed properties)?
Daniele Rota Nodari 1-Aug-22 6:51am View     CRLF
Better don't use UI controls as data containers. Reading/Writing data (like TextBox.Text) involves copying, allocations, marshalling operations and other unwanted overhead (like cross-thread invocations). Keep your text elsewhere (e.g.: local field or property) and use it for any data-aware operation (like searching). Try also to cut down the times you set the Text property, by batching/merging updates and using optimized methods, like AppendText. Obsviously such approach might require complex structures to link the raw data to the UI counterpart, so you have to evaluate a proper trade-off. Anyway, you may end up without the need of a TextBox.
Daniele Rota Nodari 31-May-21 10:28am View    
What is the relation between the two forms? do them exist independently or one is open as consequence of an action on the other form?
Daniele Rota Nodari 21-Apr-20 6:01am View     CRLF
My previous reply was lost! :( PlaceLoc substitutes Place everywhere you are using it to fetch the unique combinations. That means inside the CROSS JOIN (and inside _All). After substitution, the DISTINCT keyword will no longer make difference and you can remove it. You are using "select DISTINCT PLACE......" to gather exactly what is already inside PlaceLoc.
Daniele Rota Nodari 20-Apr-20 14:39pm View     CRLF
The records are duplicated, then you need to instruct the query processor to avoid repetitions. An alternative to DISTINCT is GROUP BY, but id would not add value to the query; it would render it longer and less readbale. The only way to avoid duplication is to prevent it by having a table containing only the key combination records; that is, a table with only PlaceId and Loc fields, populated without repetitions; that would become a master/parent table.