Click here to Skip to main content
15,034,986 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get pdf file names? Pin
OriginalGriff4-Jul-21 7:57
mveOriginalGriff4-Jul-21 7:57 
GeneralRe: How to get pdf file names? Pin
Alex Dunlop5-Jul-21 4:43
MemberAlex Dunlop5-Jul-21 4:43 
GeneralRe: How to get pdf file names? Pin
OriginalGriff5-Jul-21 5:44
mveOriginalGriff5-Jul-21 5:44 
GeneralRe: How to get pdf file names? Pin
Alex Dunlop5-Jul-21 7:21
MemberAlex Dunlop5-Jul-21 7:21 
GeneralRe: How to get pdf file names? Pin
OriginalGriff5-Jul-21 7:53
mveOriginalGriff5-Jul-21 7:53 
QuestionIs it possible to update content of an xml file in DropBox using DropBox API? Pin
Alex Dunlop2-Jul-21 8:51
MemberAlex Dunlop2-Jul-21 8:51 
AnswerRe: Is it possible to update content of an xml file in DropBox using DropBox API? Pin
Dave Kreskowiak2-Jul-21 19:08
mveDave Kreskowiak2-Jul-21 19:08 
QuestionHow to add frame and Label controls at the same time by clicking a button in Xamarin? Pin
Alex Dunlop1-Jul-21 6:44
MemberAlex Dunlop1-Jul-21 6:44 
Hi I want to add Label and Farme controls in a way that Label's text is placed inside the Frame and the Frame size is changed based on text lenght. Actually, I want to add this XAML code by clicking a button:
<StackLayout x:Name="MyStack">
                        <Frame BackgroundColor="GreenYellow" CornerRadius="5" Padding="5">
                            <Label Text="Just For Test" FontAttributes="Bold" FontSize="Medium" />
                        </Frame>
                    </StackLayout>

between these code:
XML
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MReport.TabbedMainPage">
    
    <!--Pages can be added as references or inline-->
    <ContentPage Title="New Report" IconImageSource="NewReport.png" BackgroundImageSource="blue_windows.jpg">
        <StackLayout Margin="5">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="10*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ScrollView>
                    <StackLayout x:Name="MyStack">


                        <!--Labels and Frames should be added here programmatically every time the button clicked-->
                    </StackLayout>
                </ScrollView>
                <Button Grid.Row="1" Text="Add New Item" Clicked="Button_Clicked" />
            </Grid>
            <Button Grid.Row="1" Text="Send" />
        </StackLayout>
    </ContentPage>
    <ContentPage Title="Report History" IconImageSource="History.png" BackgroundImageSource="blue_windows.jpg" />
    <ContentPage Title="Messages" IconImageSource="Message.png" BackgroundImageSource="blue_windows.jpg"/>

</TabbedPage>

I tried this:
private async void Button_Clicked(object sender, EventArgs e)
       {
           MyStack.Children.Add(new Frame { CornerRadius = 5, BackgroundColor = Color.Azure});
           MyStack.Children.Add(new Label { Text = time_text[0].ToString() });
           MyStack.Children.Add(new Label { Text = time_text[1].ToString(), FontAttributes = FontAttributes.Bold, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) });
       }

But it cannot add text inside the Frame.
Please help me.

modified 1-Jul-21 12:51pm.

AnswerRe: How to add frame and Label controls at the same time by clicking a button in Xamarin? Pin
Gerry Schmitz1-Jul-21 7:20
mveGerry Schmitz1-Jul-21 7:20 
GeneralRe: How to add frame and Label controls at the same time by clicking a button in Xamarin? Pin
Alex Dunlop1-Jul-21 7:27
MemberAlex Dunlop1-Jul-21 7:27 
Questionshow the Name of ID datagridView cell0 to cell1 Pin
remiki1-Jul-21 0:21
Memberremiki1-Jul-21 0:21 
AnswerRe: show the Name of ID datagridView cell0 to cell1 Pin
Richard Deeming1-Jul-21 0:46
mveRichard Deeming1-Jul-21 0:46 
GeneralRe: show the Name of ID datagridView cell0 to cell1 Pin
remiki1-Jul-21 1:31
Memberremiki1-Jul-21 1:31 
AnswerRe: show the Name of ID datagridView cell0 to cell1 Pin
OriginalGriff1-Jul-21 1:02
mveOriginalGriff1-Jul-21 1:02 
QuestionHow to count Label controls count in Xamarin? Pin
Alex Dunlop29-Jun-21 4:56
MemberAlex Dunlop29-Jun-21 4:56 
AnswerRe: How to count Label controls count in Xamarin? Pin
Richard Deeming29-Jun-21 5:24
mveRichard Deeming29-Jun-21 5:24 
QuestionPassing parameter from one page to another Pin
Alex Dunlop28-Jun-21 6:59
MemberAlex Dunlop28-Jun-21 6:59 
AnswerRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 7:02
mveGerry Schmitz28-Jun-21 7:02 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop28-Jun-21 7:08
MemberAlex Dunlop28-Jun-21 7:08 
GeneralRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 7:29
mveGerry Schmitz28-Jun-21 7:29 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop28-Jun-21 7:34
MemberAlex Dunlop28-Jun-21 7:34 
GeneralRe: Passing parameter from one page to another Pin
Gerry Schmitz28-Jun-21 8:02
mveGerry Schmitz28-Jun-21 8:02 
GeneralRe: Passing parameter from one page to another Pin
Richard Andrew x6428-Jun-21 14:23
professionalRichard Andrew x6428-Jun-21 14:23 
GeneralRe: Passing parameter from one page to another Pin
Richard MacCutchan28-Jun-21 21:13
mveRichard MacCutchan28-Jun-21 21:13 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop29-Jun-21 4:53
MemberAlex Dunlop29-Jun-21 4:53 

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.