Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Make gui draggable by picture???


  • Please log in to reply
8 replies to this topic
  • Guests
  • Last active:
  • Joined: --
I have a 'hud' type of gui that goes on the desktop showing a bunch of different numbers, and then above them i have added a small picture, and want to be able to drag around the GUI when click-dragging the picture, how can i do this?
this is the part that im assuming i need to modify:

Gui, Show, x1260 y185
Gui, Add, Text, x0 y-200 vMyText444 cLime,
Gui, Add, Picture, x78 y0, C:\blah\pic.png


Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008
People will either need more detail/information, or more code.

I don't think you provide enough of either to allow an accurate or useful answer. In theory, the code you have should make a gui that is drag-able, so this isn't an accurate snippet.

Aside from that, 20 different methods of doing what you are doing spring to mind, so in general maybe your entire gui can be enhanced.





cents++

  • Guests
  • Last active:
  • Joined: --
Posted Image

i want to make this whole gui draggable when i click the orange circle...

  • Guests
  • Last active:
  • Joined: --
click and drag the orange circle, i mean

Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008

click and drag the orange circle, i mean



OnMessage(0x201, "WM_LBUTTONDOWN")
SetTimer,DRAW_SCENE, 20


WM_LBUTTONDOWN()
{
   PostMessage, 0xA1, 2
   return
}

I don't know what method you used to do that (though it looks pretty cool btw), I use the above example to move my little GDI/gui graph/charts. I honestly do not know if it is your answer but can't hurt to try. Can say it is tested as working for me. I got it from the german __Diagramm__.ahk file.

  • Guests
  • Last active:
  • Joined: --
cool ok ty.

so then i have to stick something in the Gui, Add, Picture line of the code that links it to that function? ?

Carcophan
  • Members
  • 1578 posts
  • Last active: Nov 27 2013 06:46 PM
  • Joined: 24 Dec 2008

cool ok ty.

so then i have to stick something in the Gui, Add, Picture line of the code that links it to that function? ?


Thats the thing. I dont know. We don't know. :)

My example works with a GUI that has a GDI image drawn on it. You normally cannot drag/move images (Your original request). But you mention GUI, so you gui is invisible and have no controls, so you obviously have more advanced code than you are posting.

We understand the desire to keep the code and all under wraps, but a screenshot and psudo-code aren't too helpful. Other than turning the gui frame/titlebar/border back on, and makeing it untransparent again, i dont know what else to say. 8)

VxE
  • Moderators
  • 3622 posts
  • Last active: Dec 24 2015 02:21 AM
  • Joined: 07 Oct 2006
OnMessage(0x201, "WM_LBUTTONDOWN") ; put this line at the top of your script.



WM_LBUTTONDOWN() ; put this function anywhere in your script.

{

   PostMessage, 0xA1, 2

   return

}


  • Guests
  • Last active:
  • Joined: --
you helped me a lot and made my day thank you