Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,879 members, 7,810,370 topics. Date: Saturday, 27 April 2024 at 07:50 AM

Post Ur Vb 6.0 Questions Here - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Post Ur Vb 6.0 Questions Here (40183 Views)

A Comprehensive Tutorial On Vb 6.0 / My Board Games In Vb 6.0 / Vb 6.0/vb .NET & Intranet/internet Application Development (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (16) (Reply) (Go Down)

Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:33pm On Jun 16, 2007
Post ur Vb 6.0 questions here
Re: Post Ur Vb 6.0 Questions Here by Lagoseko(m): 6:54pm On Jun 19, 2007
Can u help me write a program in V b.U can reach me wit 08024074294
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 3:13pm On Jun 20, 2007
CAN ONE GIVE A HELP ON THE FFG:
CODES OR HOW TO ANIMATE A SPLASH SCREEN AND MAKE IT LOADS 1ST B4 ANY OTHER FORMS IN A VB 6.0 PROJECT
ALSO HOW TO EFFECT A MARQUEE ON A FORM IE MAKE A TEXT MOVE CONTINOUSLY ON A FORM
Re: Post Ur Vb 6.0 Questions Here by binkabir(m): 4:57pm On Jun 20, 2007
[color=#990000][/color]
pls can u with the API calls that can see data that are in the serial port. this is very important from my final year project thanks
Re: Post Ur Vb 6.0 Questions Here by IG: 6:17pm On Jun 20, 2007
@binkabir, there's this dll called inpout.dll.
It gives you access to the ports on your PC. But you will have to make direct API calls to it.
You will find some usefull info here http://www.logix4u.net/

Although the site talks about parallel ports, you can still use inpout with serial ports.

@Dynast, assuming your splash screen is name frmSplash and the main form you want show
after the splash screen is frmMain.

- Go to project-properties and change the startup object to frmSplash
- On frmSplash drop a timer control and set it's interval property (in the properties window)to the duration you want to keep the splash screen on Note that the interval is in milliseconds, so 5 seconds will be 5000.

- Double click on the timer and put the following code in the event handler

unload me
frmMain.show


This implies that five seconds after showing frmSplash. frmSplash will unload itself and then show frmMain.

hope that helps.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:38pm On Jun 20, 2007
Sorry, our server was down that is why I was unable to view consistently your posts.

Dynast you need splash screen which has to be selected from project Exploer, whixh means it has to load first.

I will give u two codes to that effect

The first one will MARQUE a text entered into Label continous on a form;

You need a timer, set its interval to 100
A label and a module

Private Sub Timer1_Timer()
MoveDown Label1, Me
End Sub

paste this in vb module

Public Sub MoveDown(Obj As Control, frm As Form)
Obj.Move Obj.Left, Obj.Top - 30

If (Obj.Top + Obj.Height) < 0 Then
Obj.Top = frm.Height
End If
End Sub

For splash screen

Load any form
Load a vb module and paste the below control on the module

Option Explicit
Public ControlTblname As String
Private Declare Function CreateEllipticRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
ByVal Y2 As Long) As Long

Private Declare Function SetWindowRgn Lib "User32" _
(ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long


Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Public Sub Bubble(frm As Form)

Dim iret
Dim a As Integer
Dim b As Integer
Dim C As Integer
Dim D As Integer
Dim e As Integer
Dim f As Integer
Dim w As Integer
Dim X As Integer
Dim Y As Integer
Dim z As Integer
Dim current As Double
Dim pp As Integer
'frm.Move(0, 0) = 0
w = frm.Height: X = frm.Width: Y = frm.Top: z = frm.Left
a = 0: b = 0: C = w: D = X: e = Y: f = z: pp = 0
Do While a < frm.Height / 17 Or b < frm.Width / 17
a = a + 25
b = b + 25
e = e + 70
f = f + 70
If a > frm.Height / 15 Then a = a - 24
If b > frm.Width / 15 Then b = b - 24
Call frm.Move(f, e, D, C)

current = Timer
Do While Timer - current < 0.01
DoEvents

Loop

iret = SetWindowRgn(frm.hwnd, CreateEllipticRgn(0, 0, b, a), True)
If pp = 0 Then frm.Show: pp = 1
Loop
current = Timer
Do While Timer - current < 1
DoEvents
Loop

'This will make the bubble "pop" and minimize the form.
'Comment out if you want it to remain displayed

'iret = SetWindowRgn(frm.Hwnd, CreateEllipticRgn(0, 0, 0, 0), _
True)
iret = SetWindowRgn(frm.hwnd, CreateRectRgn(0, 0, 1000, 1000), True)


End Sub

On the form double click, on the load event type Call Bubble(frmSplash)

It will animate it for you

I hope that helps
you
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:41pm On Jun 20, 2007
Lagoseko I poseted this to help anybody I can who needs help. So if u think I can help you, say it here or if it is confidential you let me know, you can reach me on 08036025235
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:43pm On Jun 20, 2007
I suggest you go to www.vbsourcecode.com or www.codeproject.com or google it out you see more examples
Re: Post Ur Vb 6.0 Questions Here by Fdeveloper(m): 2:26pm On Jun 21, 2007
binkabir:

[color=#990000][/color]please can u with the API calls that can see data that are in the serial port. this is very important from my final year project thanks

If you're using VB6, then you don't need to use a Windows API as there is a native custom control which enables interaction with the serical port (MSCOMM.OCX). The following link demonstrates it's use in a short application: http://www.programmers-corner.com/sourcecode/111
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 5:33pm On Jun 22, 2007
Thanks very kindly and God bless LuckyCo and IG
I will try it out
Re: Post Ur Vb 6.0 Questions Here by binkabir(m): 9:08pm On Jun 23, 2007
luckyCO and IG i'm very very grateful for the info and the webs maybe i'll have u when i'm thru with me project grin grin grin grin grin grin
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 1:18pm On Jun 25, 2007
Hi Niralanders can any one help me with VB Codes that will be able to trap a date entered into a textbox compare it with the current date of the day and display on a pop up window or on the same form the No of days,Month(S),years below or above that given date entered on a text box.
If the difference in dates can only be in months or days its alright.

Hoping to hear 4m the great programmers in the land
Stay blessed
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 1:36pm On Jun 25, 2007
Please make your question clear. Do you want a program that will allow you enter a date in the textbox then it will minus it from the current date and then display the result inform of year(s), month(s) and day(s)?

If it is what you need plz try this one;

Load a new form

Load a textbox 'Text1' and commandbutton 'Button1' and double click at Button1, it will bring out its code event

Delete all the codes you can see on that code view and paste the code below, run it , enter any date and click the button called Execute.

If you didnot see anything, know it that you have not entered valid date.

Instead of you using Textbox why no use Dtpicker and assign its value instead of converting textbox becasue a user might enter in valid data which is not so in Dtpicker.




Private Sub Command1_Click()
Dim sDate As Date

If IsDate(text1.Text) = False Then Exit Sub
sDate = CDate(text1.Text)

MsgBox Minusdate(sDate, True)

End Sub

Function Minusdate(DComp As Date, AllowNegativeValue As Boolean) As String
Dim K As Integer
Dim yr As Integer
Dim mn As Integer
Dim dy As Integer

K = DateDiff("d", DComp, Date)
If AllowNegativeValue = True Then K = Abs(K)

AllowNegativeValue = False


If K > 365 Then
yr = K \ 365
mn = K Mod 365
If mn > 30 Then
mn = mn \ 30
dy = mn Mod 30
End If

ElseIf K < 365 And K > 30 Then
yr = 0
mn = K \ 30
dy = mn Mod mn
ElseIf K < 30 Then
yr = 0
mn = 0
dy = K

Else
AllowNegativeValue = True
Minusdate = " You cannot have less that zero value"

End If

If AllowNegativeValue = False Then
Minusdate = Str$(yr) + " year(s) " + Str$(mn) + " month(s) " + Str$(dy) + " day(s)"
End If

End Function

Private Sub Form_Load()
Command1.Caption = "&Execute"

End Sub
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 4:56pm On Jun 30, 2007
It seems we dont have any problems in vb6.0?
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 12:01pm On Jul 02, 2007
Thank you very kindly LuckyCO
I ve tried the program u benevolently posted here but its still not running.
I think a label or some other thing is supposed to be used to trap output I still need more assistance to make it run well.

To make my question clearer,suppose a certain establishment is responsible for awarding contracts,
I need a program(Codes) that will be able to compare the contract duration say 3 years with the current date of any day and give a message say "YOU HAVE 2 YEARS AND 3 MONTHS LEFT TO FINISH THIS CONTRACT" or "THIS CONTRACT DURATION HAS BEEN EXCEEDED BY 3 MONTHS"
The program should be able to use the date the contract is awarded, the duration of the contract and the current date of any day
It shld be able to stop displaying the message once the contract status is "COMPLETED"
There are several status 4 the contract such as "ongoing","abandoned",Revoked & COMPLETED
THERE ARE SO MANY CONTRACTS ALL STORED IN A DATABASE, This program shld be able to check the status of each of those contracts in the database and give information whether the duration of the contract has been exceeded or still much time still left to finish the contract.
Hope this is enough information
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 1:35pm On Jul 02, 2007
God bless you ambundantly LuckyCO, you are indeed a guru in programming,
I just dimensioned cdate as date intead of string and the program is running marvellously well
I never know we hav this type of brain in Africa let alone a Nigerian and u r as well very generous with ur talent and hardwork.
Infact the sky is your spring board or rather stepping stone. I need comments on the keyword of the codes.I am still learning.
Nwanne Chukwu gozie gi[i][/i]
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 6:25pm On Jul 02, 2007
What I give is the best answer to that.
Just get the of the contract as date entered and minus against the system data, it will display the information readily the way it has just done that.

Then add the code

if Cdate(Text1.text)=date then
msgbox("The program time is reached")
else
msgbox Minusdate(sDate, True)
end if
Re: Post Ur Vb 6.0 Questions Here by Josh4ever9: 7:23pm On Jul 02, 2007
This question has been bothering me.

I have two listboxes and when I selectan item in one, I want the other list box to lose it's selection/focus.

what happens now is that If i select something in list box a, then go and select something in list box b, the item in list box a remains selected and i dont want this to happen.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:12am On Jul 03, 2007
You have two listboxes with the same number of values inside meaning that Listbox1.listcount=Listbox2.listcount?
If so the program below solves the problem.

Load a form

Drop Two ListBoxes which represents your two listboxes filled with values. I filled my own to with numbers and xters to demonstrate.

Go to code event and delete everything there and paste this;

Dim List1Val As Integer
Dim List2Val As Integer

Private Sub Form_Load()
Dim j As Integer

For j = 1 To 10
List1.AddItem "Item in Listbox 1, index " & j
List2.AddItem "Item in Listbox 2, index " & j
Next j

End Sub


Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List1Val = List1.ListIndex

If List2Val >= 0 Then
List2.Selected(List2Val) = False
End If

End Sub


Private Sub List2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
List2Val = List2.ListIndex

If List1Val >= 0 Then
List1.Selected(List1Val) = False
End If
End Sub

Hope it helps.
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 10:33am On Jul 03, 2007
Dynast thank for your compliments.

Below are the comments but dont mind if there is any errors in typing.

Private Sub Command1_Click()
Dim sDate As date 'Variable that will hold date that is converted

If IsDate(text1.Text) = False Then Exit Sub ' Checks whether what entered in the textbox is date else it will not do anything. If using DTPicker control, this check would have been unneccessary.

sDate = CDate(text1.Text) ' Having seen that what you entered is date, it will now convert it to date.


MsgBox Minusdate(sDate, True) ' this calls function Minusdate which return a value that will be displayed as a popup.

End Sub

' Here is the function

Function Minusdate(DComp As Date, AllowNegativeValue As Boolean) As String

'declaration center for year,month and day
Dim K As Integer
Dim yr As Integer
Dim mn As Integer
Dim dy As Integer



K = DateDiff("d", DComp, Date) ' This obtains the difference bw the date entered and the system date in days. 'd' means in days. If I put M or yyyy instead of d it means in month and year respectively. Try and see.

If AllowNegativeValue = True Then K = Abs(K) ' This checks whether if the date entered is greater than the current date. In that case it will be negative. The function allows you to pass a parameter saying whenever a negative value is seen, it should be converted to positive. This happens only when AllowNegativeValue=true


AllowNegativeValue = False ' I initialized it to false because I dont want to create another variable, I still want to uise the same variable for other things.


'This place checks whether the day diffrernce bw the two dates is more than 365 meaning that it is up to a year.

If K > 365 Then
yr = K \ 365 ' to obtain number of years
mn = K Mod 365 ' to obtian number of months

If mn > 30 Then
mn = mn \ 30
dy = mn Mod 30 ' to obtain number of days
End If

ElseIf K < 365 And K > 30 Then ' To check whether the difference is not up to a year and more than a month
yr = 0
mn = K \ 30 ' Obtains number of months
dy = mn Mod mn ' obtains number of days

ElseIf K < 30 Then ' If it is not up to a year and month definitely it must be up to day.
yr = 0
mn = 0
dy = K ' Obtains number of days

Else

'If you dont want to process any negative date, here return the messsage below
AllowNegativeValue = True
Minusdate = " You cannot have less that zero value"

End If ' closes the check

If AllowNegativeValue = False Then
Minusdate = Str$(yr) + " year(s) " + Str$(mn) + " month(s) " + Str$(dy) + " day(s)"
'converts the yr,mn,dy to string such that both of them will be on the same data type.
End If

End Function

Private Sub Form_Load()
Command1.Caption = "&Execute" ' changes the label name to 'Execute'

End Sub
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:22pm On Jul 03, 2007
Maybe I should think that nobody has any more problems in Vb 6.0.
Take care and bye for now.
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 5:18pm On Jul 10, 2007
Pls I need a Program to allow an administrator to assign a username and password to users in order to gain entry into a system
The program shld allow the administrator to have overiding previlede using his password to access any users account and view the content and at the same time restrict a user from accesing a given section of a software say an a cashier who post credit shld not have access to debit and vise versa.The administrator shld be allowed to deny access to a user or delete the user when necessary.
The program shld allow as many accout as possible to be created.
Also it shld be able to detect username duplication and prompt for a change
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:50pm On Jul 10, 2007
Are u talking about writing a program, an independent or a program that will control authentication on windows Operating system?

make urself more clearer
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 3:26pm On Jul 11, 2007
What I need is a VB program that will allow users to create

an account using Username and Password and use same to log

into the main software. However there shld be an

administrative password with the username administrator to

allow for administrative priviledge to enter and can deny a

user from gaining access or still an administrator can delete

a users' account.The program shld be able to detect duplicate

username and prompt for a change. The program shld allow as

many user account as possible to be create. Also the program

sld allow the administrator to view all the accounts created

and delete any one he/she wishes or deny a user access to any

specific part of the software such as cashier who post credit

shld not have access to debit and vise versa
Re: Post Ur Vb 6.0 Questions Here by Zule(m): 8:25pm On Jul 16, 2007
please i need to design a civil service payroll accounting system for a state but i need help from every one
as in designing the input specifications
interface
if possible display a designed interface
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 7:26am On Jul 17, 2007
Zule first get their manual data on how the do it. Paper on all financial, grade and personal details should be studied. This will enable you know how database design will look like. If u dont ve them you will find it difficult to achieve the obj in fewer time.


When u get them say;

The next thing is to determine the back end, MYSQL,Access,SQLserver,Oralce. U can as well think whether the program will be network (LAN) based or standalone(Only one system).

I think that will help.

Let me more things u need if this cant help u.
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 5:05pm On Jul 17, 2007
Nairalanders Iam still waiting for solution to the users Account Authentication however I have limited the problem to:

--------Users should be allowed to create an account using Username and password
--------Users will log into a form called Mainpage using the accout already created
--------An administratior with username Administrator and a password to be entered thru a textbox will be able to edit users such that any user account can be deleted
-------It should be able to detect duplicate username and prompt for a change
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 5:43pm On Jul 17, 2007
Dynast what do u mean by System? Do u mean ur own program or Operating system?

If system u mean is ur own program then tell me the backend(database ) you want to use such that I can write the program for u
Re: Post Ur Vb 6.0 Questions Here by Zule(m): 9:38pm On Jul 17, 2007
the program is going to be a on a stanalone system that is not network based
i hope to use Access for the program any way

am going to get the materials
butif any one has the material
pls don't hesitate to inform me
Re: Post Ur Vb 6.0 Questions Here by neeyee(m): 6:39am On Jul 18, 2007
1. How can I link picture and Image to database?
2. And is it compulsory that I use SQL rather than the built-in VB6 database?
I will be happy for your soonest response.
Re: Post Ur Vb 6.0 Questions Here by Dynast(m): 2:12pm On Jul 18, 2007
I mean my own VB created application not operating system
Backend- Built in VB database -- Database created using Tables of Dynaset type with the database name "userAccount.mdb"
Re: Post Ur Vb 6.0 Questions Here by luckyCO(m): 8:01pm On Jul 18, 2007
neeyee You can link Image to your VB program stored in database in two diff ways.

1. You can store the image in a folder and store the path in database as text or string.
Say the path is C:\pic1.jpg store in the database.
To reprieve and store in an image control do this;

Image1.pitcure=Loadpicture( rs!pic)
rs servers as you recordset already connected and data retirved.
This is the best option

2. To store the image itself to the database. To do that create two field which types must be one Binary and number in access, Blob in MySQl or SQL server.

Find below is one attarchment that will help you out.


It must not be SQL server any database can be of help.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (16) (Reply)

Java Programming For Dummies / Nigerian Software Engineer given test to prove he is an engineer at JFK Airport / Facebook Is Suing Me For This

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 74
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.