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 LoadProductImag es(DataSet dsImages)
{
WebBrowser wb;
int i = 0;
int x = 0;
foreach (DataRow dr in dsImages.Tables[0].Rows)
{
i++;
wb = new WebBrowser();
pnlImages.Contr ols.Add(wb);
wb.Name = "webThumb" + i.ToString();
wb.AllowWebBrow serDrop = false;
wb.AllowNavigat ion = false;
wb.ScrollBarsEn abled = false;
wb.IsWebBrowser ContextMenuEnab led = true;
wb.WebBrowserSh ortcutsEnabled = false;
wb.ObjectForScr ipting = this;
wb.ScriptErrors Suppressed = true;
wb.DocumentText =
"<html><head><s tyle>" +
"body,table,tr, td,img{margin:0 px; padding:0px; display:inline;
vertical-align: bottom; }" +
"</style></head><body><cen ter>" +
"<img src=\"" + cIMAGE_HOST +
dr[ProductImageDCS chema.FileName].ToString() + "\" " +
"height=\"1 00\" " +
"onclick=\"wind ow.external.Thu mbnail_Click('" +
dr[ProductImageDCS chema.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)
{
webSelectedImag e.DocumentText = String.Empty;
mstrSelectedIma geFileName = ImageFileName;
** webSelectedImag e.DocumentText =
"<html><head><s tyle>" +
"body,table,tr, td,img{margin:0 px; padding:0px; display:inline;
vertical-align: bottom; }" +
"</style></head><body><cen ter>" +
"<img src=\"" + cIMAGE_HOST + ImageFileName + "\" " +
"height=\"1 80\" " +
"onclick=\"wind ow.external.Sel ectedImage_Clic k('" + ImageFileName +
"')\">" +
"</center></body></html>";
webSelectedImag e.Refresh();
}
public void SelectedImage_C lick(string ImageFileName)
{
if (webSelectedIma ge.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**********@g mail.comwrote in message
news:eU******** ******@TK2MSFTN GP03.phx.gbl...
Sorry, no idea from that description...
Marc