Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
/// <summary>
/// Verkrijgt een ImageBox (PictureBox) door coördinaten (x & y)
/// De coördinaten mogen gelijk waar op de ImageBox zijn
/// </summary>
/// <param name="mousex">De x locatie</param>
/// <param name="mousey">De y locatie</param>
/// <example>PictureBox foto = GetImageBoxByLocation(20, 50);</example>
/// <returns>Een picturebox als hij er een vind anders NULL</returns>
private PictureBox GetImageBoxByLocation(Int32 mousex, Int32 mousey)
{
//Verkrijg elke control in het form
foreach (Control c in this.Controls)
{
//Nakijken of het wel een picturebox is
if (c.GetType() == new PictureBox().GetType())
{
//De picturebox maken door middel van een cast
PictureBox imagebox = (PictureBox)c;
//De lokale var's zetten
int x = imagebox.Location.X - 1;
int y = imagebox.Location.Y - 1;
int xwidth = x + imagebox.Width + 2;
int yheight = y + imagebox.Height + 2;
//Kijken of de x & y van de parameters in de picturebox liggen
if ((mousex > x && mousex < xwidth) && (mousey > y && mousey < yheight))
{
//return die picturebox
return imagebox;
}
}
}
//Geen gevonden = null, dus returnen we ook null
return null;
}
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.