Re: Using autoscroll

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you want to move object A then the process is the same as normal, select
the object and move it according to the mouse values. If you want it to
remain visible while being moved regardless of it's position then you could
update the window's auto-scroll positions to ensure that the object was in
the viewing area.

This will be handled by your own particular brand of drawing canvas
interpretation. Without knowing what that code is doing I will be unable to
make a suggestion.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Steve Magoon" <owkmann@xxxxxxxxxxxxxxxx> wrote in message
news:O7FiHFxVFHA.2196@xxxxxxxxxxxxxxxxxxxxxxx
>> If I understand what you're wanting to do, you want to be able to
>> selectively scroll objects within your panel, taking advantage of the
>> AutoScroll capabilities. For example:
>>
>> You have three objects in the panel - A, B, and C. If you select A and
>> scroll the panel, you *only* want A to scroll - B and C should retain
>> their positions.
>
>
> Yah, you're right. I didn't explain myself very clearly; thanks for the
> 'translation'. I have three objects drawn into a panel. I want to scroll
> one of them without affecting the others. Each object has its own Matrix
> and Properties that I can change. I'm wondering if it's possible to do
> this on a panel using its autoscroll properties, or should I try scrolling
> individual objects with a scroll bar from the tool box?
>
> I hope this makes more sense.
>
> Thanks for helping this novice!
>
> Steve
>
>
>
> "Scott McChesney" <scott.NO.SPAM.mcchesney@xxxxxxxxxxx> wrote in message
> news:ebgOEBwVFHA.548@xxxxxxxxxxxxxxxxxxxxxxx
>> Steve -
>>
>> If I understand what you're wanting to do, you want to be able to
>> selectively scroll objects within your panel, taking advantage of the
>> AutoScroll capabilities. For example:
>>
>> You have three objects in the panel - A, B, and C. If you select A and
>> scroll the panel, you *only* want A to scroll - B and C should retain
>> their positions.
>>
>> If I have it right, I believe it is possible. From my way of thinking,
>> you'll have to store which objects are selected, and then in your Paint
>> event, you'll have to "undo" the scroll translation on all unselected
>> objects. That way, they should remain in their current position, while
>> all others scroll as appropriate.
>>
>> If you're using a retained-mode system, probably the best thing to do (if
>> you aren't already) is to store the transformation to apply within each
>> object. That way, you could apply the appropriate translations
>> (scrolling or otherwise) to each object - in this case, you would only
>> apply the scrolling translation to the selected objects. That would
>> provide the best control over object placement. I don't think the Panel
>> control provides a Scroll event, but you could apply the scrolling
>> translation in your Paint event before you actually draw each object.
>>
>> I'm not nearly the GDI+ expert that Bob is, so he may have a better
>> solution. But this is how I'd tackle the problem.
>>
>> HTH
>>
>> - Scott
>>
>> "Steve Magoon" <owkmann@xxxxxxxxxxxxxxxx> wrote in message
>> news:OCNkxAnVFHA.3864@xxxxxxxxxxxxxxxxxxxxxxx
>>>I would like to autoscroll objects as I select them (via hit testing),
>>>separately, on a panel. In other words, if I select drawing (A) with the
>>>mouse, then the autoscroll function would apply only to that object. Is
>>>this possible with autoscroll, or is there a better way? I have several
>>>objects that I'm drawing to a panel using a retained mode graphics
>>>method.
>>>
>>> Thanks for your help,
>>>
>>> Steve
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Using autoscroll
    ... You can certainly use the AutoScroll capabilities of the Panel control to do ... write some translation code within your Paint event. ... >> selectively scroll objects within your panel, ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Using autoscroll
    ... > selectively scroll objects within your panel, ... > You have three objects in the panel - A, B, and C. ... I want to scroll one ... panel using its autoscroll properties, or should I try scrolling individual ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Using autoscroll
    ... AutoScroll capabilities. ... You have three objects in the panel - A, B, and C. ... scroll the panel, you *only* want A to scroll - B and C should retain their ... but you could apply the scrolling translation in your Paint ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Genrevouz Point - "Agent Shoujo"
    ... If you scroll down, you'll notice the author's being quite the ... a-hole over the translation. ... Panel 3: "The master is beckoning." ...
    (rec.arts.anime.misc)
  • Re: Genrevouz Point - "Agent Shoujo"
    ... If you scroll down, you'll notice the author's being quite the ... a-hole over the translation. ... Panel 3: "The master is beckoning." ...
    (rec.arts.anime.misc)