I have a picture box in my application which displays pictures. Now if user clicks the picture/picture box then he should be redirected to the hyperlink given for that particular image in picturebox.
Is it possible? If yes, then how , if no then what would be an alternative?
I am using C# (Windows development)
Let me know for any inputs from my side
thanks
using System.Diagnostics;
private void pictureBox1_Click(object sender, EventArgs e)
{
Process.Start("http://www.stackoverflow.com/questions/5713934/give-url-to-picturebox");
}
Related
I am developing a web browser using C# and XAML.
I want to make system that when users enter texts or numbers other than the URL in a URL display form, the screen display remains the same, but only the inside of the form is automatically blanked out and ready to be reentered.
I know that I need to add something to the code below, but I don't know how.
Please help.
private void txtUrl_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
wbSample.Navigate(txtUrl.Text);
}
private void Sum(object sender, EventArgs e)
{
AddSign('+');
calculatorString.Focus();
}
After pressing button I want to focus on the end of entry.
Image with design of app, xaml code and description of my problem :)
I suppose you have to create a CustomRenderer. Here some notes
Entry CustomRenderer
Then you should use setSelection
I have a C# Windows Forms App that contain a menu bar.
I want to display a Help Message when I press on the "HELP" menu button.
All that I can see when I press view code is this:
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
}
I think that I need to create inside the function a MessageBox or an event that will display the desired message.
Do you have any idea how should I do this, please?
Below should work for what your asking. If you are on your form you can double click the button you want to interact with, and Visual Studio should take you to the empty method.
private void helpToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("This is supposed to be helpful");
}
I am working at a problem in ASP.NET.
I have to create 2 windows (i think that I need to make web forms, i don't know why they said windows) one is the login form, when i press ok and the username and password is ok, I need to
show my second window (webform)
How can I do that?
I tried to do
protected void Button1_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.SetFocus("id");
}
But it gives me error
A form tag with runat=server must exist on the Page to use SetFocus() or the Focus property.
What should I do?
Am i right, I have to do separate webforms for thoose windows?
This is the picture from the problem that they provided
If you use webforms you can just use the following code to redirect to second form:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Webform2.aspx");
}
I'm not using the in-built browser control (ie wrapper) but i'm using Webkit.Net instead
When i click on button1, the WebkitBrowser will navigate to the link typed on textBox1
private void Button1_Click(object sender, EventArgs e)
{
backgroundWorker1.Navigate("https://www.facebook.com/cocacola");
}
Can i detect when user click on the Like button ? For example when the user likes the page, a MessageBox appears and says that the page has been successfully liked !
Anyhelp would be highly appreciated