473,497 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

controlling scrolling in a form programatically

Hi,

I am currently trying to write a simple game using vb.net

the form I am working on is 800*600 (this is set as the maximum size)
and autoscroll is set to true. The user moves around the screen by
moving a picturebox (sprite) with the cursor keys.

When the user hits the bottom of the screen I want the screen to
automatically scroll down to keep the picture box in view - The screen
I want to work with is 800*1200 but the window should not resize above
800*600. I would also like to keep a status bar (just a text box) on
the bottom line of the screen (displaying lives etc - this needs to
remain fixed even if the screen scrolls)

Any ideas?

I had a couple of ideas myself - create a "background" picture box
that is 800*1200 (this then displays scroll bars in the form). Then
create a couple of hidden picture boxes, one at the top of the screen
and one at the bottom of the screen. When the user moves the sprite
picture box below the bottom of the form (y>=600) then move focus to
the bottom picture box. And when they move above this (y<600) focus
on the top picture box. In this way the form appears to auto scroll.

However, this means that the status bar gets lost when the screen
scrolls (although I suppose I could move this programatically when the
screen moves). Of course I'll need to trap the user scrolling around
the form themselves as well.

Also heard about mdi forms (never used them though) would I be able to
have the scrolling form as a child with the status bar as a parent?

Finally, how do you programatically scroll a form - I couldn't find
any obvious commands like scrollwindow(x,y)?

thanks in advance

Scott M.
Nov 20 '05 #1
0 1456

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3642
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the...
1
3488
by: Susan | last post by:
I have a bound form and subform and am trying to enter the data in both forms programatically. The Linkmaster and Linkchild properties are set. My intent is to be able to look at the data before it...
1
1281
by: Neil | last post by:
I'm trying to get up to speed on ASP.Net & C# development having come from a VB6 background. I know that I can refer to an inner control of a formview control by using a lines such as ...
1
1324
by: Trint Smith | last post by:
I know that this may belong in the asp group, but I want to programatically control the web form image control. For example, I want to let the program choose the image url at load time and the...
5
5817
by: Kent Briggs | last post by:
VB 2005 Express. I have a readonly multiline textbox with a vertical scrollbar. I'm programatically adding text to it with textbox1.appendtext(mytext) and it scrolls automatically. However, I only...
8
2163
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
0
1202
by: Wilfried Mestdagh | last post by:
Hi, I have a form containing a menu strip where I add programatically items on it, depending on a real time situation that can change. This is the view to explain what I'm trying to tell: ...
0
1298
by: SteelNetNob | last post by:
I am having a problem where I have a COM application that can be run stand-alone and programatically via COM interop. If an instance of the COM application is being run when my .NET application that...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.