Solved

Marquee to select multiple control at Run Time

Posted on 2002-07-09
6
148 Views
Last Modified: 2010-05-02
 I am writing an application that allow user to place vb control into form at Run Time. I am able to draw a marquee by using a shape.

  My problem is :
1. how to select the objects within the marquee that I have drawn

This is just like what we always did at design time when we select multiple control and move it but I want it to be done during the Run Time.

Please guide me.

Sweetpillow.
0
Comment
Question by:sweetpillow
6 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
Here is an example (not very clever) that checks whether the controls on the form are within the bounding rectangle of the shape control.

Private shpMarquee As Shape

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If (shpMarquee Is Nothing) Then
        Set shpMarquee = Me.Controls.Add("VB.Shape", "shpMarquee")
        With shpMarquee
            .Visible = True
            .Top = X
            .Left = X
        End With
    Else
       
    End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If shpMarquee Is Nothing Then Exit Sub
    On Error Resume Next
    If Button > 1 Then
        List1.Clear
        Dim ctrlToCheck As Control
        For Each ctrlToCheck In Me.Controls
            If ctrlToCheck.Left > shpMarquee.Left And ctrlToCheck.Width + ctrlToCheck.Left < shpMarquee.Left + shpMarquee.Width And ctrlToCheck.Top > shpMarquee.Top And ctrlToCheck.Top + ctrlToCheck.Height < shpMarquee.Top + shpMarquee.Height Then
                List1.AddItem ctrlToCheck.Name
            End If
        Next
    ElseIf Button = 1 Then
        With shpMarquee
            .Width = X - .Left
            .Height = Y - .Top
        End With
    End If
End Sub
0
 

Author Comment

by:sweetpillow
Comment Utility
Hi TimCottee,

  How to do like vb design time when we draw a marquee the objects within marquee will be selected and the marquee will be hidden but all the selected objects will have 8 handles ?
  Then when we click on any of the selected objects, we can move all objects at one time. I wonder if there is any windows function doing this job...

Sweetpillow.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi sweetpillow,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

sweetpillow, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:sweetpillow
Comment Utility
Hi Dan,

       The comment from Tim really do not exactly stimulate what I want to do. Thats why I do not accept his comment as answer. My last comment is not answered anyway. But nevermind, I have found a solution by myself by using another picture mouse down, mouse move and mouse up to stimulate the real box when user is dragging the mouse. Thanks.

Note: By the way, I would like to know how to delete a question when I no longer wanted it ?

Sweetpillow.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
In the future, you can post a 0-pt question to the Community Support Topia Area.  Be sure to identify the question by its Q# or the full URL.

For this question, you do not need to do anything because it is already in the cleanup queue.  I think that Tim Cottee's comments are worth preserving so...
Moderator,  I am changing my recommendation to:

   Refund and save as 0-pt PAQ
==========
DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now