Staredit Network > Forums > Technology & Computers > Topic: Visual Basic question
Visual Basic question
Jan 28 2009, 4:54 pm
By: Devourer  

Jan 28 2009, 4:54 pm Devourer Post #1

Hello

Hi,
I'm way new to Visual Basic and I just done some simple things like MsgBox buttons and so on.
I know the code Me.Location and ofc the If statement and other codes...
whatever, I'm using the 2008 express edition and I want a lable be moved each time you press the button "<-" 5 [or more/less] pixels to it's left. The same with the "->" button (ofc in the right direction then^^)

How does that works? I tried some codes but they moved all the time.



Please report errors in the Staredit.Network forum.

Jan 28 2009, 7:46 pm Riney Post #2

Thigh high affectionado

Ive never used 2008, cause VB6 is sexier than all but vb 6 it would be

Code
Me.Left = Me.Left - 5


Dunno if 2008 uses Left and top still



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Jan 28 2009, 9:58 pm TriggR_HappE Post #3



Make sure you substitue "Me" with "Label1" or whatever name you've given your label so it looks like:

Label1.left = label1.left -5

Label1.left = label1.left +5



None.

Jan 28 2009, 10:01 pm Riney Post #4

Thigh high affectionado

Yea that too, I think Me only worked with frm's anyway

But it would be lblWhatever.Left or vb6 would shit on your code ;o



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Jan 30 2009, 5:12 pm Devourer Post #5

Hello

It worked fine. Thanks.
Well, one more question (google failed again)
Is it possible to run actions always? Without any condition.
I'm using Microsoft Visual Basic 2008 Express Version, a Forms application.



Please report errors in the Staredit.Network forum.

Jan 30 2009, 8:16 pm Riney Post #6

Thigh high affectionado

I suppose if you did a loop in a on_Load() you could



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Jan 30 2009, 8:30 pm Devourer Post #7

Hello

Quote from name:Dark_Marine
I suppose if you did a loop in a on_Load() you could
I'm new to visual basic... whats the code for a loop, and where exactly should I place the loop? k thx.



Please report errors in the Staredit.Network forum.

Jan 30 2009, 8:36 pm Riney Post #8

Thigh high affectionado

Private Sub Form_Load()
Do while X <> Y
Code
Loop
Exit Sub

As long as you dont make Y possible, itll loop as long as the program is going. Now if you WANT it to stop, make X = Y

Remember this is VB6 code, however as stated it may work with VB2008 as well.

EDIT: Or to reduce lag (If there is any to begin with) You could always run a timer

Code
Private Sub Status_Timer()
   If ConnectToServer = True Then
       If Not AllDataReceived Then
           Call SendData("stuff" & END_CHAR)
       Else
           lblOnline.Caption = "Online"
           lblOnline.ForeColor = vbGreen
       End If
   Else
       picNews.Caption = "Could not connect. The server is offline."

       lblOnline.Caption = "Offline"
       lblOnline.ForeColor = vbRed
   End If
End Sub


Heres some Code I stole from my RPG that uses a timer named Status, every time Status reaches 0, it resets its count to whatever you set, and runs the specified actions.



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Jan 31 2009, 12:17 am Kellimus Post #9



That's why you should just do it in Visual C++, its better than VB.



None.

Jan 31 2009, 12:38 am Syphon Post #10



Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.



None.

Jan 31 2009, 12:47 am Kellimus Post #11



Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.



None.

Jan 31 2009, 1:06 am A_of-s_t Post #12

aka idmontie

Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Jan 31 2009, 1:32 am Kellimus Post #13



Quote from A_of-s_t
Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.

Giving some advice to switch over to a faster, compiled language is worthless? Damn, you guys are whack.



None.

Jan 31 2009, 8:25 am Riney Post #14

Thigh high affectionado

Quote from Kellimus
Quote from A_of-s_t
Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.

Giving some advice to switch over to a faster, compiled language is worthless? Damn, you guys are whack.

VB has been KNOWN to be an easier language to write with, and it is up to the OP weither or not to use it.



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Jan 31 2009, 8:29 am Kellimus Post #15



Quote from name:Dark_Marine
Quote from Kellimus
Quote from A_of-s_t
Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.

Giving some advice to switch over to a faster, compiled language is worthless? Damn, you guys are whack.

VB has been KNOWN to be an easier language to write with, and it is up to the OP weither or not to use it.

Easier doesn't mean better ;) And you're right. Just trying to give some advice on a better language though.



None.

Jan 31 2009, 8:27 pm Syphon Post #16



Quote from Kellimus
Quote from name:Dark_Marine
Quote from Kellimus
Quote from A_of-s_t
Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.

Giving some advice to switch over to a faster, compiled language is worthless? Damn, you guys are whack.

VB has been KNOWN to be an easier language to write with, and it is up to the OP weither or not to use it.

Easier doesn't mean better ;) And you're right. Just trying to give some advice on a better language though.

Actually, this was my point. Visual C++ is easier to use than C++ because of the GUI, but it still isn't as fast or as good, so I was saying, 'Well, why not go all the way for good, or all the way for ease?'



None.

Jan 31 2009, 9:41 pm Kellimus Post #17



Quote from Syphon
Quote from Kellimus
Quote from name:Dark_Marine
Quote from Kellimus
Quote from A_of-s_t
Quote from Kellimus
Quote from Syphon
Quote from Kellimus
That's why you should just do it in Visual C++, its better than VB.

Then why not go all the way and just do it in C++.

Visual C++ and C++ are almost the same except Visual C++ gives you a GUI to work in. So it wouldn't matter.
The point is, he is using Visual Basic. So answer the question (which has been answered), or don't post worthless replies.

Giving some advice to switch over to a faster, compiled language is worthless? Damn, you guys are whack.

VB has been KNOWN to be an easier language to write with, and it is up to the OP weither or not to use it.

Easier doesn't mean better ;) And you're right. Just trying to give some advice on a better language though.

Actually, this was my point. Visual C++ is easier to use than C++ because of the GUI, but it still isn't as fast or as good, so I was saying, 'Well, why not go all the way for good, or all the way for ease?'

Ah, good point.



None.

Jan 31 2009, 9:44 pm Devourer Post #18

Hello

stop that mass quotes...
actually, if I start debugging NOTHING happens now! :(



Please report errors in the Staredit.Network forum.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[06:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[05:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
[2024-5-16. : 5:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
Please log in to shout.


Members Online: 2charlottee5585hp5, Oh_Man, 9milac7723wh5, Roy