Solved

add scrollbar to picturebox

Posted on 2001-07-08
16
460 Views
Last Modified: 2012-05-04

how we can add scrollbar(v & h) to a picturebox
0
Comment
Question by:vfathi
  • 6
  • 3
  • 2
  • +4
16 Comments
 
LVL 3

Expert Comment

by:andysalih
ID: 6262230
this does exactly what you want
exactly

you can download the file and build of it

http://www.planetsourcecode.com/xq/ASP/txtCodeId.22705/lngWId.1/qx/vb/scripts/ShowCode.htm

hope this helps

cheers
Andy
0
 

Author Comment

by:vfathi
ID: 6262251

Dear sir,

i couldn't receive that  .ocx file and
that picturebox didn't have any scroll.
why and what i should do?

thanks
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6262646
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:vfathi
ID: 6263734

Dear sir,

thanks for your answer but it could not help me.
i want to make a picturebox and some textbox into
it, when i make another textbox into a picturebox
it take scroll Automatic like when we add files into
a menu, it make scroll Auto.
hope you notice my mean and help.

thank you
wait for your reply soon
0
 
LVL 11

Expert Comment

by:Otana
ID: 6263844
Use a PictureClip Control. Place a scrollbar against a PictureBox, and in its Change Events Move the PictureClip, and refresh the PictureBox with the Clip as image.
0
 

Author Comment

by:vfathi
ID: 6263954

please tell me how i can make this:
i want make a picturebox and some(example:3) textbox into it that when type into textboxes(in 3th), if it is another data for textbox, when i click enter,it make automatically add textbox(like number 4), into picturebox and
i can type into 4th textbox and ...

can you help me, please.
thanks
0
 
LVL 11

Expert Comment

by:Otana
ID: 6263986
you should make a control array of textboxes. whenever you need another textbox, load a new one, like:

load TextBoxArray(4)
TextBoxArry(4).Show
TextBoxArray(4).SetFocus

You can set the coordinates of the new textbox before showing.
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6264797
vfathi, when a proposed answer doesn't fulfil your requirements, you should probably reject the answer to put your question out of the "Locked Questions" area.

Lunchy
Friendly Neighbourhood Community Support Moderator
Lunchy@experts-exchange.com

0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6266212
The best solution I've found for making a scrollable picturebox is to embed it inside another picturebox and include a vertical and horizontal scrollbar to handle the movements.

It's not a trivial task to code it, but the simple way is to simply size the inner picturebox (Picture2) to the outer picturebox (Picture1) less the scrollbar sizes:

' ensure that picture1 is inside picture2--usually done at design-time rather than here.
Set Picture2.container = Picture1

Picture2.Borderstyle=0 ' no border

' resize picture2
Picture2.move 0,0,picture1.scalewidth - VScroll1.width, picture1.scaleheight - HScroll1.height

' move scrollbars to the right/bottom
VScroll1.move Picture2.width,0, VScroll1.width, Picture2.height
HScroll1.move 0,Picture2.height, Picture2.width

Then, when the scroll bars are scrolled, move the picture up/down or left/right
0
 

Author Comment

by:vfathi
ID: 6268820

Dear sir,

this is my questions?

1) in VB, now on a picturebox or by rich textbox or another,
i need two columns, one of them for counting and the other
for typing, like this.
|------------------------------|
|                              |
|  |-----textbox------|  |-1-| |
|  |------------------|  |---| |
|                              |
|  |------------------|  |-2-| |
|  |------------------|  |---| |
|                              |
|  |------------------|  |-3-| |
|  |------------------|  |---| |
|                  counterbox  |
|------------------------------|



after typing the last word by the user on the first textbox,
and pushing Enter key, cursor must go to the second textbox
automatically.
of course by paying attention that when the cursor is on the
second textbox, the counterbox put the number there,
automatically. i mean when i'm in the second textbox, the
counter put 2 number automatically, and...

2) now, please consider we have 3 textbox and 3 counterbox.
now if a user want to use the fourth textbox, the program
must be able to run it for user, automatically.

3) but about scroll length:
as we had considered just 3 counterbox and textbox, so
we have no scroll here at all.
but after increasing boxes the program must be able to
create vertical scroll, of course automatically.

if the characters typed by user are more than our textbox
length, so we will need a horizontal scroll here, too.


can you help me, please?
it will be very kind of you to advice me, if it's possible.
thanks for your time and attention.


regards

0
 

Author Comment

by:vfathi
ID: 6268917

like this:

|---------------------------|
|  |----textbox---|   |-1-| |
|  |--------------|   |---| |
|                           |
|  |--------------|   |-2-| |
|  |--------------|   |---| |
|                           |
|  |--------------|   |-3-| |
|  |--------------|   |---| |
|             counterbox    |  
|---------------------------|

0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6269980
Interestingly enough, this is almost identical to the examples in the book "Teach Yourself ActiveX Controls in Visual Basic 5.0 in 21 Days".  Look for this book in the bookstore.  It may be in the discount section since it's VB5, but its information is still current!
0
 

Author Comment

by:vfathi
ID: 6271828

Dear sir,

sorry, i couldn't find it.
please tell me how i must write my program
for solve my questions?

thanks
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 20 total points
ID: 6273680
Briefly,

Create a user-control which has the textboxes and various properties and methods to handle the settings.  Add features to handle the counting based on a property (PerformSum) which will query the parent container for all components of that type and display a total.

It's 21 chapters, so summarizing in one paragraph is tough.

The scroll feature will have to be added separately, probably through a scroll component and a picturebox.  Then place each combocomponent into the picturebox and the scrollbar outside on the right.
0
 

Expert Comment

by:costello
ID: 6400408
Rejecting proposed answer.

Force accepting rspahiz' comment unless someone objects in the next 4 days.

costello
Community Support Moderator @ Experts-Exchange
0
 

Expert Comment

by:amp072397
ID: 6783408
Points to rspahitz as suggested by costello.

amp
community support moderator
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DIR issue 7 54
Microsoft Access combo box help 2 46
I need help embedding an image as HTML in my vb.net application 3 67
RUNRMTCMD from AS/400 12 47
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

773 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