Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


help with vb 2008 code
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
rayz321
Grandmaster Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 579

PostPosted: Wed Apr 01, 2009 2:35 pm    Post subject: help with vb 2008 code Reply with quote

ok i am working on a way to make a button background color to change useing a timer so far i got
Code:
Button1.BackColor = Color.Orange
but i am not sure What to put after that or anything if you help me and it works +rep

Edit: i also want to know how to do it with background immages

_________________
Views and counting since 9/14/09

Make Money for surfing ads!
Back to top
View user's profile Send private message
cheesecan
Expert Cheater
Reputation: 0

Joined: 01 Oct 2006
Posts: 215

PostPosted: Wed Apr 01, 2009 3:01 pm    Post subject: Re: help with vb 2008 code Reply with quote

rayz321 wrote:
ok i am working on a way to make a button background color to change useing a timer so far i got
Code:
Button1.BackColor = Color.Orange
but i am not sure What to put after that or anything if you help me and it works +rep

Edit: i also want to know how to do it with background immages


Im pretty sure with visual basic you can just put it in a on click event


maybe try this ?

Button1.BackColor = Color.FromName("Red")
Back to top
View user's profile Send private message
rayz321
Grandmaster Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 579

PostPosted: Wed Apr 01, 2009 3:08 pm    Post subject: Reply with quote

but i want it to do it automatically and change colors at a set interval
Edit: mabey the colors could be random but still not sure how to do what i asked in the first post

_________________
Views and counting since 9/14/09

Make Money for surfing ads!
Back to top
View user's profile Send private message
Karakawe
I post too much
Reputation: 3

Joined: 17 Apr 2007
Posts: 3899

PostPosted: Wed Apr 01, 2009 3:14 pm    Post subject: Reply with quote

There's a General Programming section if you want to give that a go. (Never bothered with VB, sorry.)
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 01, 2009 3:19 pm    Post subject: Reply with quote

http://msdn.microsoft.com/en-us/library/system.drawing.color.fromargb.aspx
Back to top
View user's profile Send private message
rayz321
Grandmaster Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 579

PostPosted: Wed Apr 01, 2009 6:02 pm    Post subject: Reply with quote

slovach wrote:
http://msdn.microsoft.com/en-us/library/system.drawing.color.fromargb.aspx

how i use it i dont get how ?

_________________
Views and counting since 9/14/09

Make Money for surfing ads!
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 01, 2009 6:08 pm    Post subject: Reply with quote

Write a routine that cycles colors by gradually going through RGB...
Back to top
View user's profile Send private message
rayz321
Grandmaster Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 579

PostPosted: Wed Apr 01, 2009 6:36 pm    Post subject: Reply with quote

slovach wrote:
Write a routine that cycles colors by gradually going through RGB...
um sorry but what does that mean
_________________
Views and counting since 9/14/09

Make Money for surfing ads!
Back to top
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Wed Apr 01, 2009 8:37 pm    Post subject: Reply with quote

.Lol I don't know if you want this but I do think it is cool Very Happy

Timer Code:
Code:

me.button1.timer1.Interval = 100
        On Error Resume Next
        me.button1.BackColor = Color.FromArgb(Math.Round(-(Control.MousePosition.X.ToString & Control.MousePosition.Y.ToString), 10))


Lol I love this code and I am always modifying it.

_________________
CEF will always stay alive.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 01, 2009 9:07 pm    Post subject: Reply with quote

Why do you have .ToString there?
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Apr 02, 2009 3:38 am    Post subject: Reply with quote

Code:

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms

Namespace ColorTune
    Public Partial Class Form1
        Inherits Form

        Public Sub New()
            InitializeComponent()
            r = startColor(0)
            g = startColor(1)
            b = startColor(2)
        End Sub

        Private startColor As Integer() = {0, 0, 0}
        Private endColor As Integer() = {255, 255, 255}
        Private r As Integer, g As Integer, b As Integer
        Private rand As New Random()

        Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.BackColor = Color.FromArgb(startColor(0), startColor(1), startColor(2))
            Me.timer1.Enabled = True
        End Sub
       
        Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
            r += rand.[Next](0, 10)
            If r > endColor(0) Then
                r = startColor(0)
            End If

            g += rand.[Next](0, 10)
            If g > endColor(1) Then
                g = startColor(1)
            End If

            b += rand.[Next](0, 10)
            If b > endColor(2) Then
                b = startColor(2)
            End If

            Me.BackColor = Color.FromArgb(r, g, b)
           
           
        End Sub
    End Class
End Namespace


slovach, why is my code fucked up :/

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
rayz321
Grandmaster Cheater
Reputation: 0

Joined: 17 Aug 2008
Posts: 579

PostPosted: Thu Apr 02, 2009 1:54 pm    Post subject: Reply with quote

Jorg hi wrote:
.Lol I don't know if you want this but I do think it is cool Very Happy

Timer Code:
Code:

me.button1.timer1.Interval = 100
        On Error Resume Next
        me.button1.BackColor = Color.FromArgb(Math.Round(-(Control.MousePosition.X.ToString & Control.MousePosition.Y.ToString), 10))


Lol I love this code and I am always modifying it.

ok it works prety good


to guy in last post befor me your code did not work for my vb 2008 it said santax error for imports and one other thing i think

_________________
Views and counting since 9/14/09

Make Money for surfing ads!
Back to top
View user's profile Send private message
shhac
Expert Cheater
Reputation: 0

Joined: 30 Oct 2007
Posts: 108

PostPosted: Thu Apr 02, 2009 2:06 pm    Post subject: Reply with quote

slovach wrote:
Why do you have .ToString there?
To let him use the & operator to make the two numbers into one longer number, e.g. if X was 345 and Y was 781 then it would produce 345781 as a string and then this gets implicitly changed back to an float/simple because it is in the Math.Round function.

@Naablet you don't have any handles assigned to any of what you posted.

Nobody seemed to really answer rayz321's original question.
In the designer, double click on timer from the list on the left, then left click on the new timer at the bottom (probably Timer1) once so you can change the properties, set enabled to true and the interval how often you want the colour to change in milliseconds. Next, double click on the timer and in the new Sub that has now been made automatically add this (or one of the other codes of your choosing)
Code:
Button1.BackColor = Color.FromArgb((New Random).Next(0,256), (New Random).Next(0,256), (New Random).Next(0,256))
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Apr 02, 2009 4:15 pm    Post subject: Reply with quote

huh, didn't know & is also for string concatenation in VB.
Back to top
View user's profile Send private message
shhac
Expert Cheater
Reputation: 0

Joined: 30 Oct 2007
Posts: 108

PostPosted: Thu Apr 02, 2009 4:37 pm    Post subject: Reply with quote

Do not many people on this forum know VB.NET? =/ I've been looking at the level of questions that've been answered and those that haven't and I'm beginning to doubt that the question I asked (a few threads down) will be answered.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites