Sign in to follow this  
Followers 0
mikelee33

Drag and Drop with Input Box Contents Highlighted

4 posts in this topic

I am having a difficult time consistently creating a GUICtrlCreateInput box which has its contents highlighted. I must be missing something. The input box receives a drag and drop file, but is not highlighted, so any pre-existing file is not replaced by the newly dropped file. I actually have to manually highlight any pre-existing file in the box before I drop a new file if it is to work properly.

I have:

GUICreate("Program", 700,300,(@DesktopWidth - 700) / 2, (@DesktopHeight - 300) / 2, -1, 0x00000010)

$file = GUICtrlCreateInput ( $input , 10, 125, 300, 20)

GUICtrlSetState(-1,$GUI_DROPACCEPTED)

So I have the gui set to accept drag and drop files, and I have gui_dropaccepted. Isn't that all I need? I am thinking there must be something else I am missing. Thanks for direction.

Share this post


Link to post
Share on other sites



Odd... I ran this exact script:

#include <GuiConstants.au3>

GUICreate("Program", 700,300,(@DesktopWidth - 700) / 2, (@DesktopHeight - 300) / 2, -1, 0x00000010)
$file = GUICtrlCreateInput ( "Bla" , 10, 125, 300, 20)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)
GUISetState()

While 1
    Sleep(1000)
WEnd

And for me, the inputbox highlighted it's contents when i dragged desktop icons onto it.

Share this post


Link to post
Share on other sites

I agree - odd. That is why I had mentioned that I couldn't get it to "consistently" work. Some (most) of my gui's highlight the input box, but this example from this particular gui doesn't. So now that I know that is all I do indeed need I will just have to go through the rest of the script searching for some reason it doesn't work - but I'm not optimistic I'll find anything. Thank you.

Share this post


Link to post
Share on other sites

Well, if you can't figure it out, post your full code, and I and/or others would likely be willing to help you debug it. :D

Good luck!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0