Maybe this will help and maybe it won't then lol. Basic form set up is a
panel of small thumbnails of products (100x100) with a slightly larger
thumbnail (180x180) spot over to the side that displays that slightly larger
image for whatever smaller thumbnail the user selects. The user can then
click to zoom the selected which just opens a new form where they can make
it as big as they want and save the picture locally if they want. (Note:
the context menus are turned on just so I can get to the view source to try
to figure out what the heck's going on--they won't be on release).
************** CODE ********************************
private void LoadProductImages(DataSet dsImages)
{
WebBrowser wb;
int i = 0;
int x = 0;
foreach (DataRow dr in dsImages.Tables[0].Rows)
{
i++;
wb = new WebBrowser();
pnlImages.Controls.Add(wb);
wb.Name = "webThumb" + i.ToString();
wb.AllowWebBrowserDrop = false;
wb.AllowNavigation = false;
wb.ScrollBarsEnabled = false;
wb.IsWebBrowserContextMenuEnabled = true;
wb.WebBrowserShortcutsEnabled = false;
wb.ObjectForScripting = this;
wb.ScriptErrorsSuppressed = true;
wb.DocumentText =
"<html><head><style>" +
"body,table,tr,td,img{margin:0px; padding:0px; display:inline;
vertical-align: bottom; }" +
"</style></head><body><center>" +
"<img src=\"" + cIMAGE_HOST +
dr[ProductImageDCSchema.FileName].ToString() + "\" " +
"height=\"100\" " +
"onclick=\"window.external.Thumbnail_Click('" +
dr[ProductImageDCSchema.FileName].ToString() + "')\">" +
"</center></body></html>";
wb.Size = new Size(100, 100);
wb.Location = new Point((x + 3), 3);
wb.Refresh();
x += 103;
}
}
public void Thumbnail_Click(string ImageFileName)
{
webSelectedImage.DocumentText = String.Empty;
mstrSelectedImageFileName = ImageFileName;
** webSelectedImage.DocumentText =
"<html><head><style>" +
"body,table,tr,td,img{margin:0px; padding:0px; display:inline;
vertical-align: bottom; }" +
"</style></head><body><center>" +
"<img src=\"" + cIMAGE_HOST + ImageFileName + "\" " +
"height=\"180\" " +
"onclick=\"window.external.SelectedImage_Click ('" + ImageFileName +
"')\">" +
"</center></body></html>";
webSelectedImage.Refresh();
}
public void SelectedImage_Click(string ImageFileName)
{
if (webSelectedImage.DocumentText != String.Empty)
EnlargeImage();
else
MessageBox.Show("Please select an image to enlarge.");
}
************************************************** **
It's on that **ed line where it gets messed up for some reason. The first
thumbnail that gets clicked sets it fine. When another one gets clicked it
sends ImageFileName ok, but the DocumentText doesn't actually save to the
new one. When I break point it and hover over it it's almost like it hasn't
refreshed. Freakishly, however, when I view source on the selected image
web browser all it has as its DocumentText is "<HTML></HTML".
I have no idea if any of that explains the situation better, but for my sake
I hope it does ;).
"Marc Gravell" <ma**********@gmail.comwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
Sorry, no idea from that description...
Marc