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. 3 3683
If you handle the scrolling yourself it'd be easy - just build a big
picturebox, put a vertical scrollbar by the side of it and handle the scroll
events. You can then wait until you know the sprite is at the bottom, and
then force the scrollbar to do its stuff. Autoscrolling's great but can't
always be applied to every situation because you don't have full control of
it.
Good luck!
Steve
"Scott M" <sc**********@t iscali.co.uk> wrote in message
news:ea******** *************** ***@posting.goo gle.com... 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.
Hi Steve,
thanks for that, but do you have some code samples to get me started?
or explain to me how I "handle the scroll events"
regards,
Scott M.
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message news:<OP******* *******@TK2MSFT NGP12.phx.gbl>. .. If you handle the scrolling yourself it'd be easy - just build a big picturebox, put a vertical scrollbar by the side of it and handle the scroll events. You can then wait until you know the sprite is at the bottom, and then force the scrollbar to do its stuff. Autoscrolling's great but can't always be applied to every situation because you don't have full control of it.
Good luck!
Steve
"Scott M" <sc**********@t iscali.co.uk> wrote in message news:ea******** *************** ***@posting.goo gle.com... 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.
Check out the MSDN entry on the link below, and have a Google (especially
look out for any CodeProject links). Unfortunately I don't have time to give
you a sample myself, as it's already 1.30am and I'm under a deadline :-)
Good luck with it! http://msdn.microsoft.com/library/de...classtopic.asp
"Scott M" <sc**********@t iscali.co.uk> wrote in message
news:ea******** *************** ***@posting.goo gle.com... Hi Steve,
thanks for that, but do you have some code samples to get me started?
or explain to me how I "handle the scroll events"
regards,
Scott M.
"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:<OP******* *******@TK2MSFT NGP12.phx.gbl>. .. If you handle the scrolling yourself it'd be easy - just build a big picturebox, put a vertical scrollbar by the side of it and handle the
scroll events. You can then wait until you know the sprite is at the bottom,
and then force the scrollbar to do its stuff. Autoscrolling's great but
can't always be applied to every situation because you don't have full control
of it.
Good luck!
Steve
"Scott M" <sc**********@t iscali.co.uk> wrote in message news:ea******** *************** ***@posting.goo gle.com... 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 is saved and then choose to save it or
undo it. I have a Save button that just closes the form and a Cancel button that
does an undo and then closes the form. I first enter data into the main form
and then enter code into the subform. After the...
|
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 'keep perspective' attributes with visual basic .net commands.
Any help is appreciated.
Thanks,
Trint
..Net programmer
trintsmith@hotmail.com
|
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 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
|
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 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
|
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 want automatic scrolling when the thumb control is at the bottom
position. If the user scrolls up, I want it to hold its position as more
text is appended.
So basically I need to know:
1. How to detect if the scrollbar is at bottom position
| |
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 answered...
In 1.1 we always did our own myDataAdapter.fills and we liked that control
for lots of good reasons. Now the new DataSource (or is it a
TableAdapter:Dataset) automatically fills the Gridview. How can we control
that fill?
In a...
|
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:
http://www.mestdagh.biz/test/1.gif
But there can be more items so that it will not fit into the height of
the form. A possible solution is to scroll it (eventually with the top
|
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 does the COM interop starts, it latches onto a currently running instance rather than making a new instance for itself.
So here are the facts of my situation.
I have a Delphi 7 app that implements a COM Server.
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |