Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Zelos on November 17, 2005, 12:42:24 PM

Title: Load form
Post by: Zelos on November 17, 2005, 12:42:24 PM
I know how to load a form and such, but how do I do to decied where on the screen it shall pop up? like I have a big form, and on it I want at position x/y it to apphere?
Title: Load form
Post by: Numsgil on November 17, 2005, 12:51:19 PM
StartupPosition can be set to either Mainual, (where you can position it using the control in the bottom right corner that looks like a monitor) centerd in owner, centered in screen, or windows default.
Title: Load form
Post by: Zelos on November 17, 2005, 12:54:52 PM
ty, if I have a form that im gonna paint it, how do I make it add a scroll when it gets below what can be seen?
Title: Load form
Post by: Numsgil on November 17, 2005, 12:58:58 PM
I dunno that one.
Title: Load form
Post by: Zelos on November 17, 2005, 01:10:16 PM
PY? ulcissor? anyonw else then?
Title: Load form
Post by: PurpleYouko on November 17, 2005, 01:37:43 PM
Sorry.

That's an aspect I have never really played with. Most VB controls add a scroll bar automatically when the data in the window gets bigger than the window itself.

When I made a tile scroller demo a few months ago, I am pretty sure that scroll bars just popped up as soon as the picture got bigger than the window.
Title: Load form
Post by: Zelos on November 17, 2005, 01:50:26 PM
ok thx, I have 5 forms, one main and 4 others that are sub forms, when they are minimized they shall be minimized in the main form, and in the menu stuff in the lowercorner, where stuff show up in window, the main one shall be the only one visible there, how do you fix that?
and if I tell the program to save a file, that ends like .dot can the program then just load it and read it?
Title: Load form
Post by: Ulciscor on November 17, 2005, 06:53:03 PM
The program has no idea that you have tried to paint anything off the boundaries of the form so can't add a scroll bar to show it. You could make your own code for moving what you paint using a custom scroll bar by moving the co-ords of the graphics but that would be quite difficult I imagine.
I don't reallt get what you mean by the other two questions though; can you rephrase them?
Title: Load form
Post by: Zelos on November 18, 2005, 12:19:08 AM
there exist different types of files, txt, jpg and such if I want to save a file can I use any type of ending I wamt and then the program load it? and still bne able to read it?
Title: Load form
Post by: Ulciscor on November 18, 2005, 12:51:06 AM
I think so, as long as you apply the file correctly. Obviously opening a picture in a text field won't work like you want.
Title: Load form
Post by: Zelos on November 18, 2005, 04:36:37 AM
well, I wasent planning that, but what about the main/sub forms?
Title: Load form
Post by: Ulciscor on November 18, 2005, 03:48:28 PM
...what about them?
Title: Load form
Post by: Zelos on November 20, 2005, 03:58:50 PM
nvm, I know db use a code that tell the program to paint a picutre from a image in the program, but how do I do if I dont want to add the pic to the program, but use it from a file?
Title: Load form
Post by: Botsareus on November 22, 2005, 11:39:20 AM
IMAGE = LOADPICTURE( "C:\IAMVBNOOB.BMP")  :evil:

SEE:

SAVEPICTURE( "C:\IAMVBNOOB.BMP", IMAGE)

SET DESCTOP WALLPAPER API "C:\IAMVBNOOB.BMP" INTERGRATE IT INTO FILEMAG.DLL (ON EXPLORER OPEN EVENT)

 :devil:
Title: Load form
Post by: Zelos on November 22, 2005, 01:38:56 PM
can someone exept bot tell me how to do? I didnt get a shit of what he said
Title: Load form
Post by: Numsgil on November 22, 2005, 01:55:20 PM
I think he's saying there's some functions in VB called LoadPicture and SavePicture.
Title: Load form
Post by: Zelos on November 22, 2005, 03:13:58 PM
ok, hes not very good in explaining thing
Title: Load form
Post by: Zelos on December 01, 2005, 12:52:34 PM
could you nums explain better what he means by those things? I dont get it
Title: Load form
Post by: Numsgil on December 01, 2005, 01:02:45 PM
There are functions in VB called SavePicture and LoadPicture.  That's all I know.  I presume they load and save pictures to an imagebox.
Title: Load form
Post by: PurpleYouko on December 01, 2005, 04:57:01 PM
Again. You should look at the code in Darwinbots for how to do this.

Just look at the object for MDIForm1 then click the menu bar, look for the bit that allows the user to set a background image from a file then click it to see what the code says.

I can't remember exactly how it all works but I do know that Form1 has a member called BackPic into which a bitmap is loaded.

I solved all these issues way back. You will just have to check my code to see how.
Title: Load form
Post by: Zelos on December 04, 2005, 01:18:55 AM
ive looked at it, but it uses images stored in the program, I wanna use pictures that is ina seperated file outside the program
Title: Load form
Post by: Numsgil on December 04, 2005, 04:43:48 AM
Quote
There are functions in VB called SavePicture and LoadPicture.  That's all I know.  I presume they load and save pictures to an imagebox.
Again, these functions do what you want, I'm just not sure on sytnax or how you use them exactly.
Title: Load form
Post by: Zelos on December 10, 2005, 02:34:09 AM
ok I´ll give it a shot, is it possible to turn the picture like 90°?
Title: Load form
Post by: PurpleYouko on December 10, 2005, 12:14:03 PM
Quote
but it uses images stored in the program

No it doesn't!

The background image function in DarwinBots loads any picture file from any location that you have it stored in.

It has nothing to do with stuff stored in the program. In fact there ARE no picture files stored in the program. Period!
Title: Load form
Post by: Griz on December 10, 2005, 02:43:08 PM
Quote
Quote
but it uses images stored in the program

No it doesn't!

The background image function in DarwinBots loads any picture file from any location that you have it stored in.

It has nothing to do with stuff stored in the program. In fact there ARE no picture files stored in the program. Period!
still have a problem with 'sizing' them to fit the 'field' ...
any hints?
Title: Load form
Post by: PurpleYouko on December 10, 2005, 03:04:08 PM
Now that IS a problem.

I never really figured this one out, even after many hours of trying.

As best as I can tell there is no way to resize a picture on a form. But there is a way to "stretch" a picture if it is in a image object such as a picturebox.

Still never got it to work satisfactorily though.  :(