Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:12:59+00:00 2026-06-04T19:12:59+00:00

How to create a border above the grid(named as Holder) for wp7? What i

  • 0

How to create a border above the grid(named as Holder) for wp7? What i tried is, when i create the grid to full screen and after i created the border on the top of the screen but when i debug it, the border is not visible. Can anyone help me with this? Thanks in advance for your hard work!

<Grid x:Name="BrowserHost" GotFocus="BrowserHost_GotFocus" Grid.RowSpan="2">

<StackPanel x:Name="Stack" Background="Transparent">
        <Border x:Name="Border" Background="{StaticResource PhoneAccentBrush}">
            <TextBox x:Name="UrlTextBox" KeyDown="UrlTextBox_KeyDown" Background="White" Margin="0,0,98,0">
        </Border>
</StackPanel>

MainPage xaml.cs

public partial class MainPage : PhoneApplicationPage
{
    private const int NumTabs = 4;

    private int currentIndex;
    private string[] urls = new string[NumTabs];
    private WebBrowser[] browsers = new WebBrowser[NumTabs];

    public MainPage()
    {
        InitializeComponent();
        ShowTab(0);
    }

    private void ShowTab(int index)
    {
        this.currentIndex = index;
        UrlTextBox.Text = this.urls[this.currentIndex] ?? "";
        if (this.browsers[this.currentIndex] == null) 
        {
            WebBrowser browser = new WebBrowser();
            this.browsers[this.currentIndex] = browser;
            BrowserHost.Children.Add(browser);
        }
        for (int i = 0; i < NumTabs; i++) 
        {
            if (this.browsers[i] != null) 
            {
            this.browsers[i].Visibility = i == this.currentIndex ? Visibility.Visible : Visibility.Collapsed;
        }
    }
}

private void UrlTextBox_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Key == Key.Enter) 
    {
        Uri url;
        if (Uri.TryCreate(UrlTextBox.Text, UriKind.Absolute, out url)) 
        {
            this.urls[this.currentIndex] = UrlTextBox.Text;
            this.browsers[this.currentIndex].Navigate(url);
        }
        else
            MessageBox.Show("Invalid url");
    }
}

But after i debug, neither the border nor UrlTextBox is visible.

Image:

Here's an image I wanted to post

I used the GotFocus event for the BrowserHost grid. That means, when i touched the grid(BrowserHost), the UrlTextBox and the border should be collapsed(I got this thing). And what i need is the BrowserHost should attain the full screen after the Border and UrlTextBox is collapsed. But for me it is not happening. Please see the below image. I want to make the BrowserHost in full screen when the user touches on the BrowserHost. I want the empty space to be filled with BrowserHost.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:13:00+00:00Added an answer on June 4, 2026 at 7:13 pm

    You need to specify BorderBrush and BorderThickness properties for the Border, like this

    <Border Background="LightBlue" 
        BorderBrush="Green" 
        BorderThickness="2" >
    

    Update:
    Also Set Grid.Row=”0″ to your stackpanel.

    And then modify your cs code

    WebBrowser browser = new WebBrowser();
    browser.Height = 400;
    Grid.SetRow(browser, 1);
    BrowserHost.Children.Add(browser); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to create my own Border class and then insert it in my
As shown in the example above, I'm trying to create a grid of boxes/cells.
I'm looking for the best way to create a custom border around an HTML
I need to create control to draw border around its child. So, I have
I'm trying to create a horizontal menu with a thick border bar that shows
I want to create a html table with a 1pt black outer border and
Is it possible to create a MouseEnter-Event also for the border of the window?
I am trying to create a css menu. I would like to remove border
So, I want to create a custom Android TextView with a border INSIDE AN
I am trying to line up the top border of a content div with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.