Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Stop The Dragging...?


Here's what I have:
- A label control array within a picturebox. The label control array
- can be dragged left and right from one end of the picturebox
- to the other. The problem is that the control array can also
- be dragged past either end of the picturebox, making the label
- control array not usable.

Here's what I need:
- To be able to have the label control array stop from being
- dragged. In other words, have a left and right limit as to how
- far the control array can be dragged.

The way I'm doing it now.....doesn't work.
Any ideas welcome...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Form From Dragging Off-Screen
I've searched this quite a bit and keep coming up with the same results... all of which don't really solve the problem...

I have a form that I want users to drag, however, I do not want the form to cross the edges of the screen. That is, I do not want any part of the form to disappear outside the screen. The only code I've found close to this is one to snap the form to the edge of the screen (while still allowing it to be pushed outside the screen).

I've tried using the mouse position API for the form, but it doesn't capture the X and Y coordinates for when you're over the form's border. I understand this to only see the INSIDE of the form, and not the form's border included.

Thanks in advance!

Stop Title Bar Mouse Dragging
Hello Folks,
i am new to this forum but i have a problem which i have researched but failed.
I have disabled my applications titlebar,maximise button. But the title bar actually docks itself in a restored state and yet i wanted it maximised so that no one would drag it over the screen as this happens when its in a restored state.

How can i be able to disable the Mouse Click move titlebar(or application window) action.
Thanks in advance.

MSFlexGrid - Anyway To Stop Scrolling When Dragging?
Hi...

I've attempted several things to try and prevent the grid display from scrolling when I'm dragging (manual dragmode)..but nothing seems to work. Anyone knows of a way to do this?

Francis

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

Stop Dragging Links From Webbrowser Control
Hi all,
i'm creating a securelink browser application using
WebBrowser cotrol in VB6.
Our requirment is that no one can't do drag and drop
a hyperlink out side the application ,as one can do
with other browsers.
so how can i do this ,plz help me.

Thanks

Stop Error? Or I Will Stop You!
Oh the title i just wanted to get your attention. it looks like it worked though.

So now to the real problem, How do you make an easy error handler for a for next loop that sets or reads the properties of controls. and it tries to read a "timer.width".

I don't want ot know a way to avoid the error just a way to handle it.

Regards
E.P.

Dragging Help
i need to kno how to make a form so when you draag it to within 120 of the left of a screeen it sticks there, and is able to be dragged away again, like winamp can do. any help appreciated.
thank you.
ollie.

Dragging .. Please Help
Hello,

im trying to make an audio player... there is a play list (list box)... and i want it that, when the program is open, you can drag a song icon (lets say from the desktop) onto the listbox and the file name is displayed there..

can anyone please help?

Thanks!

l8er

Dragging
ok, I know what picture.drag 1 and picture.drag 2 is, but how do I conbine them to make a drag and drop thing? all I want to be able to do is drag a picturebox around the place, but how?

Dragging What?
How can I know which object is being dragged?

If I use DragMode: automatic, seems the GotFocus is not working.

What I try to do is like VB IDE, drag an object and put into another container.

Besides, I also need to draw the 6 small squares to allow user to resize.

I tried to use DragMode:Manual, but then for ComboBox, I cannot trap mouseevent like MouseDown etc !!

Any solutions???

Thanks

Knows That It Is Dragging?
If I use DragMode=Automatic,
How can I know it is being dragged?

Thanks

Dragging
I want to drag a button from one area of a form to another. I suppose this requires a calculation of the cursor position, and then some code for the Form object. But I cannot find out a way to do this seemingly obvious task. I know to set drag property of my button to "1", but beyond that it is a mystery to me.

Dragging
How can i make a object move like drag it to another spot ?

Dragging
Is there a way to drag a path from Window Explorer on to a textbox?

Dragging Help
I'm having a problem with the following code and I need a tip or workaround:

Dim OldX As Single
Dim OldY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - OldX
Source.Top = Y - OldY
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
Picture1.Drag
End If

The problem is the x,y of the form is not realized unless the cursor leaves the original plane of the picturebox. In other words if you put the cursor in the middle of a picbox that is 1000 whatevers wide by 1000 whatevers high you can't move the picture box 499 or less whatevers. Any help?

Thanks,
Joey O

Dragging
When I click on my label, the drag box comes up but when I release it the label stays in the original place, help !

Dragging A SSTab Outside Of An App.
Hello and Good day to all. Thanks for any replies to this post!

I was wondering if it is possible to enable a drag and drop method for an sstab. What i would like it to do (the app) is allow users to drag 1 of the sstabs outside of the program area and once the mouse is release, the window will act as its own independent form. For example:

__Tab1____Tab2____Tab3__


When the user clicks and Drags Tab1, they drag it outside of the main form..(so the mouse if over the desktop for example). When they release the mouse button Tab1 becomes its own form, and is independent of the main form. So if the original was closed, Tab1 would not be.

Like so:

__Tab1__________________


And this is to apply to each SSTAB.

Not sure how one would go about accomplishing this.

Any comments or suggestions would be appreciated.

Thanks again for view and/or replying to this post.

Much appreciated!

Dragging Labels Around..
Say I have a few "columns" just seperated by simple lines, with a bunch of labels in each "column", how would I go about being able to drag labels between and within columns?

Dragging A Polygon
Dear list

I have made some shapes using the polygon api and filled them with colour. Currently I can identify when the mouse is over the polygon using point(X,Y). From this I am able to drag the polygon across the screen by continually using CLS and remaking the polygon at the current mouse point. This is understandably flickery and depending on tyhe speed of the PC - can be quite slow. Has anyone got a suggestion how I could drag the polygons better. Note they cannot be placed inside another control!

any ideas would be much appreciated.

Thanks

Optom

Dragging A Polygon
I have created a polygon using the polygon function in the API. Is there any way I can drag it with the mouse as if it were an object?

Thanks

optom

Dragging An Image Over Another One
While I'm dragging an image over another one, the one under is being refreshed, which makes the movement unclear. How to get rid of this?

How Can I: Select Pcb's By Dragging...
Yo...

its been a while since i've been here...
i've tried to find an answer to my problem...
but couldnt find one.

So here is my problem:
I want to MoveOver some pictureboxes (pcb's)...
and when i hold the leftmousebutton,
i want the pcb's to change color.

Seems rather easy...
but im not really getting there...
what i got so far:

Code:
Private Sub pcbSth_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If pcbMon(Index).BackColor = &H80000001 Then
pcbMon(Index).BackColor = &H80000005
Else
pcbMon(Index).BackColor = &H80000001
End If
End If
End Sub
thing is...
i have to stand totally still for 'selecting'...
and i can only do one at a time...

anyone any ideas?

tnx anyway...

Need Help With Dragging Tiles
I been searching the board and havent found this issue addresses directly, so perhaps someone has a suggestion.

I am making a tile sliding game, so I need to be able to move tiles (in this case picture boxes) along either the x or y axis and have them scroll smoothly and I drag them with the mouse.

I have experimented with changing the pictures x or y as I register x and y from the mousemove event, but this leaves a trail and just doesn't seem to be working right.

I don't think this is too rare of an 'effect' so I assume there is a normal way to do it - do I use bitblt? I don't know much about that yet, but I see it mentioned on the board a lot.

Also, I am getting the ghost of the picture box when I drag and i dont want that. I feel I probably need to handly this sliding outside of the basic drag and drop technique but I'm not sure

Thanks for the help

Pete

Dragging In Lists
This may get a bit complex, so ill try to explain it best i can.

I have two listboxes, list1 list2.. Each item in list1 is corresponding with list2.. for example:

List1 Contents
1+1
2+2
3+3

List2 Contents
2
4
6

Is it possible to drag a list1 item from its current position (index) and move it somewhere else in the list, while also moving the corresponding list2 item to the same index in list2?

Thanks

Dragging A Image!?
Hi everyone, I was just wondering if anyone knows how to simply move an image from one place (lets say point a) to anotehr place and telling it to stay whereever i have dragged it to (lets say point b)??

thanx for the help

Dragging To A Folder
I want to create an application that when installed, creates a special folder with my unique icon. When cetain types of files are dragged to this folder, my application kicks off and runs a process on them. Is this possible in VB, or do I need to search for a different language? I searched the forum and could not find any other post like this.

Thank you.

Dragging Frames Or Tab Help?
I have a form and a SSTab1 and would like to keep some buttons that do the same thing on 3 of the 5 different Tab pages or w/e you call them. I don't know how I would keep them ontop for the certain pages. I was thinkng of a frame that can be dragged around on each form or how would I do it?

Thanks for all help

Dragging A Form
Hi all,

I have created a form that pops up and follows the curser around the screen when you are dragging an item from one list to another. This works with a timer on the form that repeatedly repositions the form next to the curser using the GetCursorPos function. I have a text box on this form that I want the user to be able to type in whilst dragging an item. If the moue button is not held down (and the form is just following the cursor), the text box accepts text quite happily, but when the mouse is held down as you are dragging an item, te text box does not accept text any more!?
I have tried using the GetKeyState function in the timer loop combined with a loop to go through the ascii key codes, to place letters that are pressed after the existing text in the box, but that doesnt account for the other keys on the keyboard such as the curser keys, delete, backspace, etc.

Does anybody have any suggestions on how I can make the text box accept input while the mouse button is pressed and dragging?

Any help would be great

Thanks in advance, Al.

Dragging An Object
I'm trying to design a seating plan kind of program for teachers where they can take a desk and drag it to where they want it...How can I allow a richtext box (the object i'm using for a desk so it can be written on) to be dragged? Also how can I get it to rotate it?

Thanks,

Dragging And Dropping
Hi,

I'm trying to make a part of a program, but I'm just getting really stuck.

I need to be able to drag and drop jpeg files into image (or picture but preferably image) boxes from windows explorer.

Can anyone help?

Thanks,

Adrian Osmond.

Dragging A CommandButton
How would i make it so that the user could drag a command Button, that is currently in a PictureBox?

Dragging Files Into VB
Ok, I am creating a project for school and I need to know if there is a way to take all the files in one folder and print just the names of the file to a .txt file.

For example

My Documents has 10 mp3's all named 1.mp3 - 10.mp3

I need to get vb somehow to extract all those to a txt file saying

1.mp3
2.mp3
3.mp3
...etc

Can this be done?

Dragging The Form
I have a form with no border. Is there a way to drag the form and move it around the screen without having the title bar to click on? thanks

Dragging Textboxes
I'd like to be able to drag one text box over another and have it copy the contents of the box into the one it's over.

Is there any way to go about doing this?

Dragging And Dropping
Does anyone know how you can drag and drop and object to anywhere on the page? If i set dragmode to automatic i can drag it but it drops back to its previous location.

Help With Image Dragging...HELP ME PLZ
in my program i am making it is like ms paint and i have an insert picture option now when the user imputs the picture it puts it on the form now how can i ame it so the user can move it to where ever they want it on the form...Plz Help

Dragging And Listbox Help
hello, i have already got code to drag a file into a list box

Private Sub Form_Load()
List1.OLEDropMode = 1
End Sub
Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Integer
If Data.Files.Count < 1 Then Exit Sub
For i = 1 To Data.Files.Count
List1.AddItem Data.Files(i)
Next i
List1.Refresh
End Sub

but i need to know how to only add certain files like exe's or jpg's etc. i also would like to know how to display only the filename in a listbox called list2. any help would be appreciated.
thank you, ollie.

Dragging && Dropping
I have a textbox on my form named "Text1"...

This textbox has a drag/drop event that takes the path of the file dropped and makes it the Text1.text...

The problem with this is... it accepts any file type...

Is there a way to limit dragging/dropping to only certain file types?
(If possible, can I have only .exe's & .lnk files accepted by the drop, with everything else causing a "cannot drop" icon?)

-------------------------------------


!!!SOLVED!!!

The harder question...

In the previous question, I wanted .lnk files to be dropped too... The only problem with this is, when you try to shell() a .lnk file, it gives an error... So, do I need to extract the .exe filepath from the .lnk, or is there a way to correctly shell() a .lnk file?

If I do have to "extract" the filepath from the .lnk to the real .exe's filepath, how do I go about this?

!!!SOLVED!!!

I figured out the second question with the help of someone's example project on how to create shortcuts and gather information from them. I'm not sure who posted it, it was one of the gurus... Thanks whoever you are!


Help on the first question still needed!

Thanks!

Form Dragging
Ok my form is useing a graphic image over the form but im having a problem dragging the form, I keep getting Compile err0r: Sub or Function not defined.


Code:
Private Sub Label3_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drag Me
End Sub

Help

Dragging Windows
right, i am making a skinned program using bmps and i would like to know how to make it so that when the user mouse downs on an image, the window follows it. Any help is much appreciated.

KeyPress While Dragging
During a drag operation of a control, the user might want to cancel the operation by pressing the Esc key. But the KeyDown event of controls doesn't seem to trigger during a drag operation so I can't provide this facility that way. I guess that subclassing the control to check for the WM_KEYDOWN message might work instead. Or can anyone think of an easier way?

Dragging SS Panels
I'm a complete newbie at VB6 so please bear with me if I explain this poorly. I have an SS Panel that I need to be able to move/drag around at runtime. I tried setting 'Drag Mode' to automatic but all that happens is when I attempt to drag , I see an outline of panel being moved but the panel itself stays put. 'Manual' seems to do nothing.

I've seen code for dragging forms and objects on forum but couldn't find any threads for panels.

thx in advance for any help

Dragging And Dropping
How can i drag something to somewhere else on the form?

Add Items Without Dragging Them In
Hi,

I'm using VB6.0 and I'm trying to find a way to create combo and textboxes without dragging them on to the form from the toolbox.
I want to make a program to print out bills and each time the value in the combo is selected, a new combo should appear without using comboboxx.visible = true.

Thanks

Dragging Mode
Well there's 2 options on picture1.dragmode and i want it so when something happens, it changes so you can't drag and drop it but i don't know what to change it to because i've tried:


VB Code:
picture1.dragmode = 1


and it doesn't work.

anybody know what to put instead?

Dragging And Dropping..
someone give me this code a few weeks back and it makes it so if you drag and drop picture 1, it makes a new copy of it in the location you just dropped it on. i wanted to know if, aswell as this, i could make it make a new "label1" and "label3" (examples, they won't be called that, just chose them for examples sake) with the same index number on the end in the same drag and drop instead of dragging and dropping them things aswell.

'add a picture box named picture1 and set index=0
Option Explicit
Dim picCount As Integer
Dim dx As Single, dy As Single

Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Load Picture1(picCount + 1)
Picture1(picCount + 1).Left = X - dx
Picture1(picCount + 1).Top = Y - dy
Picture1(picCount + 1).Visible = True
picCount = picCount + 1
End Sub

Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
dx = X
dy = Y
End Sub

Dragging And Dropping..
Would it be possible to have it so there could be a picture on your form, you drag and drop it somewhere else and the original picture stays there but a new one which is identical appears in the place you dropped it and you could do it again to create a third one and then do it over and over again?

Dragging Images, Help!!
for my programming summative im gonna make Solitaire, i got the game to deal the cards and everything but i got NO IDEA on how to move the cards arround

i want the user to be able to move the card around, then i want the program to figureout what the cards locations is, and decide wether the user can drop the card at that location when the user lets go of the mouse button..

Picture Box Dragging.. Better Way To Do It?
hi i have been using the dragover tool to transport images from picturebox to picturebox, but if i have selected a box and move my cursor over another picturebox the variable which is saved, which function should i use ? or can i stop it changing by adding another varaible!?

At the moment i just use something such as this

Private Sub Pic_temp7_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
Set Selected = Pic_temp7 'creates the temporary picture
End Sub


but as i said before if i move my cursor over another pic_temp it will replace the image which has been placed there...

Copyright © 2005-08 www.BigResource.com, All rights reserved