GPWiki.org
GPWiki.org
It is currently Wed Jun 19, 2013 2:06 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Thu Dec 04, 2008 7:16 pm 
Gamer Geek

Joined: Wed Jun 25, 2008 3:38 am
Posts: 34
Location: Comox Canada
Right now im trying to build a tile creation program for a c++ game project im doing in my basement. and for this tile creation program im using visual basic 2008 express (9.0), but not having much more experience than the complete web browser tutorial with direct sound project im at a loss for knowing how i can make image box's appear on the screen when and where i click. i do already have it showing where the user clicked, and i do have saving stuff accomplished, so i was wondering if anyone could help me out with this problem, or show me a link that can help on the matter.

thx

_________________
at the enrichment center we believe that if at first you do not succeed, you fail...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2008 12:38 am 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11199
Location: Abingdon, MD
Code:
    Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick

        Dim pb As New PictureBox

        pb.BorderStyle = BorderStyle.FixedSingle
        pb.Location = New Point(e.X, e.Y)

        Me.Controls.Add(pb)

    End Sub

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2008 4:40 am 
Gamer Geek

Joined: Wed Jun 25, 2008 3:38 am
Posts: 34
Location: Comox Canada
thx so much ;)

_________________
at the enrichment center we believe that if at first you do not succeed, you fail...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2008 10:33 pm 
Gamer Geek

Joined: Wed Jun 25, 2008 3:38 am
Posts: 34
Location: Comox Canada
while we're still in this thread and its still near the top of the forum, is there a way to make visual basic write to a new line upon saving, maybe an escape sequence? or a different function other than writealltext? in my stupidity i already tried the newline escape sequence for trying to write to a new line(the \n)

the issue is that the fstream library in c++ will be reading the file untill it gets to the end of it, and it will be much harder to make it loop a certain number of times rather than have it simply get a line and go on with life, so if anyone could tell me if this is possible and/or/both how, that would be awsome >:D lol, thx

_________________
at the enrichment center we believe that if at first you do not succeed, you fail...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 07, 2008 2:35 am 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11199
Location: Abingdon, MD
Code:
FileStream fs = new FileStream(Application.StartupPath & "\test.txt", FileMode.Create)
StreamWriter sw = new StreamWriter(fs)

sw.WriteLine("This is line 1")
sw.WriteLine("This is line 2")

sw.Close()
fs.Close()

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2008 9:16 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3746
Location: South Africa
vbCrLf or vbNewline

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2008 9:22 pm 
Dexterous Droid

Joined: Fri Aug 19, 2005 10:34 am
Posts: 3650
IGTHORN wrote:
vbCrLf or vbNewline


VB.NET, so it would be System.Environment.NewLine.

_________________
NetGore - Open source online RPG engine


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2008 9:34 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2217
Location: England
can you not just write the binary character for a new line into the string? Is it CHR$(13)

But there's two aren't there? Carriage Return + Line Feed. Is one 13 and one 14. Can't remember which. :confused

Let me consult my ascii wall chart...


... ok
13 = Carriage Return
10 = Line Feed

You might need to add them both in this order.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2008 10:29 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3746
Location: South Africa
Spodi wrote:
IGTHORN wrote:
vbCrLf or vbNewline


VB.NET, so it would be System.Environment.NewLine.


Damn... so many characters for a simple \n... :)

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2008 10:49 pm 
Bibliotherapist
User avatar

Joined: Wed Nov 03, 2004 1:28 pm
Posts: 6751
Location: Oxford, Englandshire
Jasmine wrote:
can you not just write the binary character for a new line into the string? Is it CHR$(13)

But there's two aren't there? Carriage Return + Line Feed. Is one 13 and one 14. Can't remember which. :confused

Let me consult my ascii wall chart...


... ok
13 = Carriage Return
10 = Line Feed

You might need to add them both in this order.



The intellisense/help popup for VB.NET's MessageBox function gives you an example of using Chr(13) & Chr(10).

_________________
10 PRINT "Bad Monkey ";
20 GOTO 10


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 2:20 am 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11199
Location: Abingdon, MD
IGTHORN wrote:
Spodi wrote:
IGTHORN wrote:
vbCrLf or vbNewline


VB.NET, so it would be System.Environment.NewLine.


Damn... so many characters for a simple \n... :)

But you only have to type about 4-6 of them and it's more immediately understandable.

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 14, 2008 7:40 am 
Dexterous Droid

Joined: Fri Aug 19, 2005 10:34 am
Posts: 3650
People most always write out the whole name when writing to others, but in practice, you will usually never write out the namespace, just "Environment.NewLine". But yeah, it can be pretty cumbersome at first. Luckily I have ReSharper, so I never have to memorize what objects are in what namespaces. :P

_________________
NetGore - Open source online RPG engine


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group