Categories
7.0 7.5 7.8 8.0 HOW TO Microsoft SDK 7.1 SDK 7.8 VB.NET Visual Studio Windows Phone

HOW TO create a bulleted list in Microsoft Windows Phone App

To create a bulleted list in Microsoft Windows Phone App you have the following options:

  1. Write text inside your xaml file using and elements
    [sourcecode lang=”xml”]
    <TextBlock TextWrapping="Wrap">
    New features:<LineBreak/>
    <Run>• No Ads</Run><LineBreak/>
    <Run>• Message Encryption with Password for a double protection</Run><LineBreak/>
    <Run>• Advanced settings</Run><LineBreak/>
    <Run>• and more…</Run><LineBreak/>
    </TextBlock>
    [/sourcecode]
  2. Write text inside you Resouces file (use SHIFT+RETURN to create new line)
    [sourcecode lang=”text”]
    New features:
    • No Ads
    • Message Encryption with Password for a double protection
    • Advanced settings
    • and more…
    [/sourcecode]
  3. Create a bulleted or numbered list in Blend

Did my HOW TO help you? Leave a reply.

Categories
C#.NET HOW TO Microsoft VB.NET Visual Studio

HOW TO extract decimal part or integer part from a Decimal number in C# or VB.NET

Exaples to extract decimal part or integer part from a Decimal number in C# or VB.NET

VB.NET
[sourcecode lang=”VBNET”]
Dim myDecimal As Decimal = 3.7 ‘myDecimal = 3.7
Dim integer_part As Integer

integer_part = Decimal.Truncate(myDecimal) ‘integer_part = 3

integer_part = Decimal.ToInt16(myDecimal) ‘integer_part = 3
integer_part = Decimal.ToInt32(myDecimal) ‘integer_part = 3
integer_part = Decimal.ToInt64(myDecimal) ‘integer_part = 3
integer_part = Decimal.Floor(myDecimal) ‘integer_part = 3

‘Following lines cause a Round (WRONG RESULT)
Dim rounded_integer_part As Integer
rounded_integer_part = myDecimal ’rounded_integer_part = 4, result different from C#
rounded_integer_part = Decimal.Ceiling(myDecimal) ’rounded_integer_part = 4

‘Obviously decimal_part is calculated as difference
Dim decimal_part As Decimal
decimal_part = myDecimal – Decimal.Truncate(integer_part) ‘decimal_part = 0.7
[/sourcecode]

C#
[sourcecode lang=”csharp”]
Decimal myDecimal = 3.7M; //myDecimal = 3.7
int integer_part;

integer_part = (int)Decimal.Truncate(myDecimal); //integer_part = 3

integer_part = (int)Decimal.ToInt16(myDecimal); //integer_part = 3
integer_part = (int)Decimal.ToInt32(myDecimal); //integer_part = 3
integer_part = (int)Decimal.ToInt64(myDecimal); //integer_part = 3
integer_part = (int)Decimal.Floor(myDecimal); //integer_part = 3
integer_part = (int)myDecimal; //integer_part = 3, result different from VB

//Following line cause a Round (WRONG RESULT)
int rounded_integer_part = (int)Decimal.Ceiling(myDecimal); //rounded_integer_part = 4

//Obviously decimal_part is calculated as difference
Decimal decimal_part;
decimal_part = myDecimal – Decimal.Truncate(integer_part); //decimal_part = 0.7
[/sourcecode]

Did my HOW TO help you? Leave a reply.