Overclock.net banner

1 - 20 of 22 Posts

·
Tech Enthusiast
Joined
·
12,388 Posts

·
Premium Member
Joined
·
8,616 Posts


This thread failed to deliver
 

·
Tech Enthusiast
Joined
·
12,388 Posts
after you make it just go and put into into the program-->startup folder.
 

·
Registered
Joined
·
152 Posts
Hey,

Just for starters, what you are doing is about the hottest thing ever.

Use Visual Basic 6 not .NET, It's easier to use and theres a lot of support out there for it. It won't do everything VB.NET will do but for most applications, including what you want, it will work fine. I would be happy to write up the code for you're program if you need it, just re-post exactly what you need it to do.

Snogus
 

·
Registered
Joined
·
1,364 Posts
As deafboy mentioned, get VB 2008 Expess: http://www.microsoft.com/express/download/default.aspx. Then I can give you a hand, maybe set it up where you type what text you want displayed in a text file. Then read by the program and displayed. That way you can type what ever mushy stuff you want (personal stuff) and we make the program display it.
 

·
Registered
Joined
·
9 Posts
Discussion Starter #12
Hey Everyone. Um, well, I had time last night to look at the vb......I read a few things, clicked on a bit. And I am pretty sure I bit of more then I can chew.


This is what I had in mind:

to make it so that when he starts his pc after getting it and installing it, lol. (I know that much.)
that there is a lil pop up on the screen that has a bunch of words one after the other, and I was thinking the font could be a lil fancy, and each word a different colour.As for the words, stuff telling him how wonderful I think/know he is


Gen or Snogus, as you both offered.....(temporary white flag waiving) I will learn this, I am determind to now, but I so need help!!

Thank you, Jamgirl
 

·
Registered
Joined
·
152 Posts
I've got tommorrow and the next day off school so i'll knock it up then and post it. Even if VB is a simple language it can be hard to learn it without some help, get a dummies guide to it, they start assuming you know how to turn on a computer and open a program so they are great for beginners.
 

·
Registered
Joined
·
6,845 Posts
VB isn't easy - it used to be, but under .NET, it's practically as difficult as C++ (just with less punctuation). That said, because GUI programming is so integral, making the pop-up window is really easy compared to my preferred language - Python.

Making the installer might be a bit tricky, as it'll involve putting an entry into the Registry. I'd envisage a seperate program, just to copy the files and write the registry entry (unless the 2008 version has an installer 'wizard', that does the coding for you)
 

·
Registered
Joined
·
1,364 Posts
Its quite long, may want to copy and paste into VB 2008 and examine it there


Code:
Code:
' NOTES:
' First and most important, you won't understand everything in this program anytime
' soon, there is a lot here. Just try to learn what you can the rest will come with time.

' You may see that a lot of the code is hidden in parts of code using "#Region"
' and "#End Region". This helps keep the code seperated and makes it easier to find
' certain parts of code. I like using region for every method and one for the
' constructor(s).

' A method (subroutine/function) will start with "Sub/Function" and end with
' "End Sub/End Function". The difference is that you can return a value from a Function.
' Look For the region named TestSub and TestFunction for some examples.

' When ever you see a line start with ' or "Rem", it is for commenting code and is never compiled into the final program.

' We will use 3 basic data types to keep thing simple:
' Integer - A number which can hold a value from -2,147,483,648 to +2,147,483,647 - Example: 1,250,000
' Single - A number that can have decimals - Example: 57.2548
' String - Text - Example: "This is a quote"
' Boolean - Has only two states, true/false or 1/0, 1 being true and 0 false

' A varible is just that a varible. Its an object we create to store a value which can change. Examples below:
' Dim MyVarible As Integer
' Dim SomeText As String
' Dim HourlyWage As Single

' "Me" is more or less the equivelent as to the name of the class, in this case "MyWindow"

Public Class MyWindow
Inherits System.Windows.Forms.Form

#Region "Constructor"
Public Sub New()
MyBase.New()
Me.InitializeComponent()
End Sub
#End Region
#Region "Declarations"
' Nothing to do here...
#End Region

#Region "Designer Generated Stuff"
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.  
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.SuspendLayout()
'
'MyWindow
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 264)
Me.Name = "MyWindow"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub
#End Region

' There is to return type on a sub.
Private Sub TestSub(ByVal FirstNumber As Integer, ByVal SecondNumber As Integer)
' Here we the numbers a and b to test function to be added together.
Me.Text = TestFunction(FirstNumber, SecondNumber)
End Sub

' Here we can see the return type as being an integer  ----------->  [----------]
Private Function TestFunction(ByVal a As Integer, ByVal b As Integer) As Integer
' And here we return the two numbers added together.
Return a + b
End Function

' Now, on to something that actually does something :)

' This Will display some text in a label that flashes between two colors every second. But first, we need to determine
' what a second is. To do that we create a timer. The next step will be when this window loads (a method called an event handler), we
' set some properties that sets how often the timer "fires", in this case ever second. Finally, we will have the last method (which
' is also an event handler) handler the "firing of the timer and that code will cause the text in the label change colors.

' Forgot the label, we also want to create it and set its properties when we do the timers.

Friend WithEvents OurSecondTimer As System.Windows.Forms.Timer ' This is our timer
Friend WithEvents OurLabel As System.Windows.Forms.Label ' Our label

' The is the event handler that gets "fired" when the window is loading. This is where we set some properties for the timer. We 
' will even toss is the method "TestSub" here too.
Private Sub MyWindow_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Here we set "HisAge" and "HerAge" to whatever you want...
Dim HisAge As Integer = 100
Dim HerAge As Integer = 100000' :)

' Now we pass the two ages together to be added and sets the windows title.
TestSub(HisAge, HerAge)

' Create a new timer and set the timers properties.
Me.OurSecondTimer = New System.Windows.Forms.Timer ' We need to create a new instance of our timer and store it in "OurSecondTimer" varible.
Me.OurSecondTimer.Interval = 1000 ' Here we set how often in milliseconds we want the timer to "fire" its event.

' Time for ice cream break :)

' Now create the label and set its properties.
Me.OurLabel = New System.Windows.Forms.Label ' Create a new instance of the timer.
Me.OurLabel.Text = "Some mushy stuff here! Not dead" & vbCrLf & "center either for some odd reason :("' Set the labels text.
Me.OurLabel.AutoSize = False ' Turn auto size off so we can set th width ourselfs.
Me.OurLabel.Width = 200' The label will be 200 pixels wide.
Me.OurLabel.Height = 24' The label will be 24 pixels high.
Me.OurLabel.TextAlign = ContentAlignment.MiddleCenter ' Set the text to the center of the label.
Me.OurLabel.Location = New Point((Me.Width / 2) - (Me.OurLabel.Width / 2), (Me.Height / 2) - (Me.OurLabel.Height / 2)) ' We positioned the label to the center of the window here.
Me.OurLabel.ForeColor = Color.Black' Make sure the default color is black
' We need to "add" the label to the window so we can see it.
Me.Controls.Add(Me.OurLabel)

' Last but not least, we need to start the timer.
Me.OurSecondTimer.Start()
End Sub

' Our timer fires every second and the event handler "OurSecondTimer_Tick" does what we want and we want to changed the color of the text in our label.
Private Sub OurSecondTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles OurSecondTimer.Tick
If Me.OurLabel.ForeColor = Color.Black Then
' The the forecolor (the text) is black, then lets make it red.
Me.OurLabel.ForeColor = Color.Red
Else
' If the color was anything other than black, make it black
Me.OurLabel.ForeColor = Color.Black
End If
End Sub

' Well, there is a start, any questions, just hollar...

End Class
Normally I do most of this stuff in the constructor, if the work needs to be done through program, if not, then it is usually done at design time in the designer, like adding the label and timer and such.

This is just a start and there is much more that can be done and added, this is just to give you a whif of what it takes to make a program work.

Any questions just ask.
 

·
Registered
Joined
·
152 Posts
Here it is,
It uses Visual Basic 6 so it's nice and simple if you want to modify it. Extract "Jamgirl.exe" to his My Documents or something then make a shortcut to "Jamgirl.exe" and put it in his startup folder and it will run when he boots, to make it go away just click it.

If you want to modify it just double click the .prj file and it will open in VB6, which you will obviously need installed.

To modify the text:
1) click the text box
2) look on the right hand side of your screen to the properties panel
3)The properties you need are:
Font - Font
BackColor - Background of the text box's color
BackStyle - Sets whether the background of the text box is transparent
ForeColor - Font color
Alignment - Text alignment
Visible - Sets whether the text is visible or not

Most of these properties also apply to the "Form" itself, but not all. Once you have made any changes you want click "file" and go to "Make Jamgirl.exe". Fiddle with the properties to you hearts content and if you mess it up just don't save it. Keep in mind that VB6 isn't big on appearances so if you want a nice background or text you'd be better off whipping something up in Photoshop or Illustrator then putting it in.

Snogus
 
  • Rep+
Reactions: Jamgirl

·
Registered
Joined
·
9 Posts
Discussion Starter #18
Gen wow, thanks so very much, I just popped on to check before bed.I will copy and paste it into VBnow and look it over tomorrow......

THANK YOU!
 

·
Registered
Joined
·
152 Posts
Gen's code is a tutorial so you can learn vb.net, i'm lost to vb.net but i don't think it does what you need, am i right Gen?
 
1 - 20 of 22 Posts
Top