Click here to Skip to main content
15,881,172 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard MacCutchan7-Sep-20 9:27
mveRichard MacCutchan7-Sep-20 9:27 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
mjeeves7-Sep-20 9:44
mjeeves7-Sep-20 9:44 
GeneralRe: Create a Multi-Layer Data Model from a MySQL Query Pin
Richard Deeming7-Sep-20 22:34
mveRichard Deeming7-Sep-20 22:34 
QuestionProblem showing a symbol from a custom font Pin
Mc_Topaz6-Sep-20 21:18
Mc_Topaz6-Sep-20 21:18 
AnswerRe: Problem showing a symbol from a custom font Pin
Richard Deeming6-Sep-20 23:04
mveRichard Deeming6-Sep-20 23:04 
AnswerRe: Problem showing a symbol from a custom font Pin
Mc_Topaz6-Sep-20 23:54
Mc_Topaz6-Sep-20 23:54 
GeneralRe: Problem showing a symbol from a custom font Pin
Gerry Schmitz7-Sep-20 7:37
mveGerry Schmitz7-Sep-20 7:37 
GeneralRe: Problem showing a symbol from a custom font Pin
Mc_Topaz7-Sep-20 22:13
Mc_Topaz7-Sep-20 22:13 
I have tried this:
XML
<Window.Resources>
    <Style x:Key="Foo">
        <Setter Property="TextElement.FontFamily" Value="pack://application:,,,/Main;component/Fonts/#MyFont" />
    </Style>
    <Style x:Key="Bar">
        <Setter Property="TextElement.FontFamily" Value="./Fonts/#MyFont" />
    </Style>
    <FontFamily x:Key="Baz">./Fonts/#MyFont</FontFamily>
</Window.Resources>
XML
<StackPanel Orientation="Vertical">
     <TextBlock Text="" Style="{StaticResource Foo}" />
     <TextBlock Text="" Style="{StaticResource Bar}" />
     <TextBlock Text="" FontFamily="{StaticResource Baz}" />
     <TextBlock FontFamily="Segoe MDL2 Assets" Text="" />
     <TextBlock x:Name="txt1" />
     <TextBlock x:Name="txt2" />
 </StackPanel>
In the code, I have tried these different ways to set the FontFamily property. I have just listed them here. But have run them separately. All failed...
C#
private void Window_Loaded(object sender, RoutedEventArgs e)
{
    txt1.FontFamily = new FontFamily("pack://application:,,,/Main;component/Fonts/#MyFont");
    txt1.FontFamily = new FontFamily(new Uri("pack://application:,,,/Fonts/"), "./#MyFont");
    txt1.FontFamily = new FontFamily("MyFont");
    txt1.Text = "\xe905";
}
Notice the txt1.FontFamily = new FontFamily("MyFont");
I have installed the font from it's ttf-file.
If I open the Character map application in Windows I can see all symbols that I require.
I just can't understand what is going on...
AnswerRe: Problem showing a symbol from a custom font Pin
Mc_Topaz7-Sep-20 23:52
Mc_Topaz7-Sep-20 23:52 
QuestionDebug does not stop on errors. Pin
MAW306-Sep-20 15:27
MAW306-Sep-20 15:27 
AnswerRe: Debug does not stop on errors. Pin
Sandeep Mewara6-Sep-20 19:09
mveSandeep Mewara6-Sep-20 19:09 
AnswerRe: Debug does not stop on errors. Pin
OriginalGriff6-Sep-20 20:32
mveOriginalGriff6-Sep-20 20:32 
SuggestionRe: Debug does not stop on errors. Pin
Richard Deeming6-Sep-20 22:38
mveRichard Deeming6-Sep-20 22:38 
GeneralRe: Debug does not stop on errors. Pin
OriginalGriff6-Sep-20 22:51
mveOriginalGriff6-Sep-20 22:51 
QuestionChanging Caption in dt Pin
MAW306-Sep-20 15:22
MAW306-Sep-20 15:22 
AnswerRe: Changing Caption in dt Pin
OriginalGriff6-Sep-20 20:45
mveOriginalGriff6-Sep-20 20:45 
QuestionCan a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 0:12
arnold_w5-Sep-20 0:12 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
OriginalGriff5-Sep-20 0:30
mveOriginalGriff5-Sep-20 0:30 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 0:36
arnold_w5-Sep-20 0:36 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
OriginalGriff5-Sep-20 0:54
mveOriginalGriff5-Sep-20 0:54 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Gerry Schmitz5-Sep-20 3:50
mveGerry Schmitz5-Sep-20 3:50 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 4:33
arnold_w5-Sep-20 4:33 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Gerry Schmitz5-Sep-20 4:58
mveGerry Schmitz5-Sep-20 4:58 
AnswerRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
Dave Kreskowiak5-Sep-20 5:39
mveDave Kreskowiak5-Sep-20 5:39 
GeneralRe: Can a button in a simple html-document somehow call a (clientside) C# method? Pin
arnold_w5-Sep-20 8:30
arnold_w5-Sep-20 8:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.