//Declaration of the linebreak LineBreak lb = new LineBreak();
//piece of code creation of the block if (_nearbyLocations[0].Address != null && _nearbyLocations[0].Address.PrimaryCity.ToString()!="") { Run rLocCity = new Run("\t" + _nearbyLocations[0].Address.PrimaryCity.ToString()); Run rLocPostal = new Run(", " + _nearbyLocations[0].Address.PostalCode.ToString()); Run rLocSubdiv = new Run("\t" + _nearbyLocations[0].Address.Subdivision.ToString()); Run rLocCountry = new Run("\t" + _nearbyLocations[0].Address.CountryRegion.ToString()); p.Inlines.Add(rLocCity); p.Inlines.Add(rLocPostal); p.Inlines.Add(lb); p.Inlines.Add(rLocSubdiv); p.Inlines.Add(lb); p.Inlines.Add(rLocCountry); p.Inlines.Add(lb); } else { Run rNoAdress = new Run("\tNo nearby location found!"); p.Inlines.Add(rNoAdress); p.Inlines.Add(lb); }
// Text from the window when executed GpsUnit ID:1GpsUnit Code:sdfgsdfgsdfgsdfgGpsUnit Latitude:40° 2' 40''GpsUnit Longitude:19° 55' 43''Location: No nearby location found!----------------------------------------------------------------------------GpsUnit Brand:WhereNet GpsUnit Description:A Wherenet GPSUnit
I solved it by using a normal textbox. The intention was to set some text bold, but this didn't work out as well as I tought. Following I've pasted some code in what manner I applied System.Environment.NewLine...
I wanted to set the underlined text into bold, but I didn't find any way to accomplish this. If there is a way, please tell me so. Oh, and when I used this code, every newline took 2 new lines. Don't know why
Richtextbox new line problem!
Bissy
b.Text = "some bold text";
Run r = new Run("some normal text");
LineBreak lb = new LineBreak();
Paragraph p = new Paragraph();
p.Inlines.Add(r);
p.Inlines.Add(lb);
p.Inlines.Add(b);
txtGPSUnitProperties.Document.Blocks.Add(p);
Techno_Dex
//Declaration of the linebreak
LineBreak lb = new LineBreak();
//piece of code creation of the block
if (_nearbyLocations[0].Address != null && _nearbyLocations[0].Address.PrimaryCity.ToString()!="") {
Run rLocCity = new Run("\t" + _nearbyLocations[0].Address.PrimaryCity.ToString());
Run rLocPostal = new Run(", " + _nearbyLocations[0].Address.PostalCode.ToString());
Run rLocSubdiv = new Run("\t" + _nearbyLocations[0].Address.Subdivision.ToString());
Run rLocCountry = new Run("\t" + _nearbyLocations[0].Address.CountryRegion.ToString());
p.Inlines.Add(rLocCity);
p.Inlines.Add(rLocPostal);
p.Inlines.Add(lb);
p.Inlines.Add(rLocSubdiv);
p.Inlines.Add(lb);
p.Inlines.Add(rLocCountry);
p.Inlines.Add(lb);
}
else {
Run rNoAdress = new Run("\tNo nearby location found!");
p.Inlines.Add(rNoAdress);
p.Inlines.Add(lb);
}
// Text from the window when executed
GpsUnit ID:1GpsUnit Code:sdfgsdfgsdfgsdfgGpsUnit Latitude:40° 2' 40''GpsUnit Longitude:19° 55' 43''Location: No nearby location found!----------------------------------------------------------------------------GpsUnit Brand:WhereNet
GpsUnit Description:A Wherenet GPSUnit
fly_eye
Its not clear how you are applying "system.Environment.NewLine" in RichTextBox.
If its in code, can you send the repro code for your scenario
Varsha Sharma
So instead of
p.Inlines.Add(lb);
use
p.Inlines.Add(new LineBreak());
St3veM
I solved it by using a normal textbox. The intention was to set some text bold, but this didn't work out as well as I tought. Following I've pasted some code in what manner I applied System.Environment.NewLine...
this.txtGPSUnitProperties.Text += "GpsUnit ID: "
+ this._myPushpinList
+ System.Environment.NewLine
+ "GpsUnit Code: " + this._myPushpinList
+ System.Environment.NewLine
+ "GpsUnit Latitude: "
+ convertToDMS(this._myPushpinList
+ System.Environment.NewLine
+ "GpsUnit Longitude: "
+ convertToDMS(this._myPushpinList
+ System.Environment.NewLine
+ "Location: ";
I wanted to set the underlined text into bold, but I didn't find any way to accomplish this. If there is a way, please tell me so. Oh, and when I used this code, every newline took 2 new lines. Don't know why
Ahmed Sajwani