From: R on 12 Apr 2010 11:48 Hello all! If you have Firefox and you open multiple tabs and then click on one tab and hold and then drag the tab, you will see that Firefox renders a small image of the page as you drag it around. I don't care too much about the drag and drop, just the rendering of the small image of the big page. Has anyone done this before or can provide me with a bit of advice on where/how to go for this. I'm looking to click on a purchase order from a list and then drag the PO (rendering the PO and therefore the transparent image) and when dropped on some other process have that process execute. The drag/drop is fine, I'm looking for the GUI of the PO form being dragged. Any help will be very appreciated! Rich
From: Larry Serflaten on 12 Apr 2010 15:21 "R" <a(a)b.com> wrote > Hello all! > > If you have Firefox and you open multiple tabs and then click on one tab and > hold and then drag the tab, you will see that Firefox renders a small image > of the page as you drag it around. I don't care too much about the drag and > drop, just the rendering of the small image of the big page. > > Has anyone done this before or can provide me with a bit of advice on > where/how to go for this. I'm looking to click on a purchase order from a > list and then drag the PO (rendering the PO and therefore the transparent > image) and when dropped on some other process have that process execute. The > drag/drop is fine, I'm looking for the GUI of the PO form being dragged. You say the drag/drop is fine? I'm wondering what that would mean considering you haven't got the drag image that you want shown? From what I can tell, (I've not done this before) you need to have your PO rendered somewhere so you can grab a thumbnail view of it. I would suggest you create a generic looking image and drag that for all the PO's... To get started, (and to dive into the deep end...) have a look here: http://msdn.microsoft.com/en-us/library/ms997502.aspx HTH LFS
From: R on 12 Apr 2010 14:30 Thanks Larry, I wasn't looking for a lesson on drag and drop. Just the rendering of the image to be dragged around. Yes I do know that if I want the dragging image to be accurate either I need a thumbnail of the actual PO rendered or a generic one size fits all look. I would be willing to compromise with the one size fits all but only if the more accurate actual rendering is just too much for trying to show as an accurate gui. I may also forget the actual drag and drop and just have a mousedown event moving a transparent thumbnail image. I'm shooting for the look. I'll check out the article you linked me to, thank you. It's quite old or appears to be but I'm hoping it will provide some direction on this. Rich "Larry Serflaten" <serflaten(a)usinternet.com> wrote in message news:eF1FAzm2KHA.4336(a)TK2MSFTNGP04.phx.gbl... > > "R" <a(a)b.com> wrote >> Hello all! >> >> If you have Firefox and you open multiple tabs and then click on one tab >> and >> hold and then drag the tab, you will see that Firefox renders a small >> image >> of the page as you drag it around. I don't care too much about the drag >> and >> drop, just the rendering of the small image of the big page. >> >> Has anyone done this before or can provide me with a bit of advice on >> where/how to go for this. I'm looking to click on a purchase order from a >> list and then drag the PO (rendering the PO and therefore the transparent >> image) and when dropped on some other process have that process execute. >> The >> drag/drop is fine, I'm looking for the GUI of the PO form being dragged. > > > You say the drag/drop is fine? I'm wondering what that would mean > considering > you haven't got the drag image that you want shown? > > From what I can tell, (I've not done this before) you need to have your PO > rendered somewhere so you can grab a thumbnail view of it. I would > suggest > you create a generic looking image and drag that for all the PO's... > > To get started, (and to dive into the deep end...) have a look here: > http://msdn.microsoft.com/en-us/library/ms997502.aspx > > HTH > LFS > >
From: Mike Williams on 12 Apr 2010 15:22 "R" <a(a)b.com> wrote in message news:e2Dr0el2KHA.5480(a)TK2MSFTNGP05.phx.gbl... > Has anyone done this before or can provide me with a bit of advice on > where/how to go for this. I'm looking to click on a purchase order from > a list and then drag the PO (rendering the PO and therefore the > transparent image) and when dropped on some other process have > that process execute. The drag/drop is fine, I'm looking for the GUI > of the PO form being dragged. Not sure which parts you are having trouble with but for rendering the image of your Purchase Order simply draw it into a suitably sized invisible Autoredraw PictureBox and then set the PictureBox's Image property as the Picture property of a similarly sized Borderless Form, setting the desired translucency of the Form using SetLayeredWindowAttributes, which is capable of handling whatever translucency level you desire and which is also capable of treating any one specified colour as totally transparentl if you wish (for example if you require rounded corners). Regarding drawing the thumbnail size image of your purchase Order into the PictureBox, much depends on how you are constructing it. If you are already actually drawing a copy of it (perhaps for printing purposes) using GDI drawing and text outpout methods and if you are creating it as a metafile then drawing the thumbnail image of it at any desired size into a PictureBox will be trivial, but if you are drawing it some other way, or if perhaps you are not currently creating a "drawn" copy of it at all and if it is perhaps just a group of Controls on a Form or whatever then there are other ways of grabbing an image of it and of drawing a resized copy into a PictureBox. Perhaps if you post again with more details it would be helpful. In the meantime, if it is only the translucent Form to drag you are having trouble with then here is a simple example of that part of it. I've not included any actual dragging code because you said you have that part covered, so this example covers only the translucency and / or trabsparency). Paste it into a VB Form containing a PictureBox: Mike Option Explicit Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetLayeredWindowAttributes _ Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, _ ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Private Const GWL_EXSTYLE = (-20) Private Const WS_EX_LAYERED = &H80000 Private Const LWA_COLORKEY = &H1 Private Const LWA_ALPHA = &H2 Private Sub Form_Load() Dim retVal As Long, n As Long, clr As Long Dim pixwide As Long, pixhigh As Long Dim Translucency As Long, InvisibleColour As Long pixwide = 240: pixhigh = 320 Me.ScaleMode = vbPixels With Picture1 .ScaleMode = vbPixels .BorderStyle = vbBSNone .AutoRedraw = True .Visible = False .Move 200, 200, pixwide, pixhigh End With Me.Width = Me.ScaleX(pixwide, vbPixels, vbTwips) Me.Height = Me.ScaleY(pixhigh, vbPixels, vbTwips) ' draw something into picbox With Picture1 .BackColor = vbWhite .DrawWidth = 4 .ForeColor = vbBlue .FillStyle = vbFSSolid .FillColor = vbCyan Picture1.Circle (120, 120), 116 .FillColor = vbYellow Picture1.Circle (120, 160), 116 .FillColor = vbMagenta Picture1.Circle (120, 200), 116 End With Me.Picture = Picture1.Image InvisibleColour = vbWhite ' or whatever you wish Translucency = 128 ' or whatever you wish retVal = GetWindowLong(Me.hwnd, GWL_EXSTYLE) retVal = retVal Or WS_EX_LAYERED SetWindowLong Me.hwnd, GWL_EXSTYLE, retVal ' if you don't want transparency as well as ' translucency then omit the LWA_COLORKEY flag SetLayeredWindowAttributes Me.hwnd, InvisibleColour, _ Translucency, LWA_COLORKEY Or LWA_ALPHA End Sub
From: Mike Williams on 12 Apr 2010 17:04
"Mike Williams" <Mike(a)WhiskyAndCoke.com> wrote in message news:ug3S9Vn2KHA.4336(a)TK2MSFTNGP04.phx.gbl... > I've not included any actual dragging code because you said you > have that part covered, so this example covers only the translucency > and / or transparency). Paste it into a VB Form containing a PictureBox: .. . . I forgot to mention that you should set the Form's BorderStyle property to None in the IDE. Mike |