Post your Vb 6.0 Questions Here

A Member? Please Login  
type your username and password to login
Date: May 16, 2008, 04:26 PM
201192 members and 113369 Topics
Latest Member: kabiyesi76
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Post your Vb 6.0 Questions Here
Pages: (1) (2) (3) Go Down Send this topic Notify of replies
Author Topic: Post your Vb 6.0 Questions Here  (Read 3090 views)
luckyCO
Post your Vb 6.0 Questions Here
« on: June 16, 2007, 08:33 PM »

Post your Vb 6.0 questions here
Lagoseko (m)
Re: Post your Vb 6.0 Questions Here
« #1 on: June 19, 2007, 06:54 PM »

 Can u help me write a program in V b.You can reach me wit 08024074294
Dynast (m)
CODES OR HOW TO ANIMATE A SPLASH SCREEN OR TEXT IN A FORM
« #2 on: June 20, 2007, 03:13 PM »

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
binkabir
Re: Post your Vb 6.0 Questions Here
« #3 on: June 20, 2007, 04:57 PM »


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
IG
Re: Post your Vb 6.0 Questions Here
« #4 on: June 20, 2007, 06:17 PM »

@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.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #5 on: June 20, 2007, 08:38 PM »

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #6 on: June 20, 2007, 08:41 PM »

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #7 on: June 20, 2007, 08:43 PM »

I suggest you go to www.vbsourcecode.com or www.codeproject.com or google it out you see more examples
Fdeveloper (m)
Re: Post your Vb 6.0 Questions Here
« #8 on: June 21, 2007, 02:26 PM »

Quote from: binkabir on June 20, 2007, 04:57 PM
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
Dynast (m)
Re: Post your Vb 6.0 Questions Here
« #9 on: June 22, 2007, 05:33 PM »

Thanks very kindly and God bless LuckyCo and IG
I will try it out
binkabir
Re: Post your Vb 6.0 Questions Here
« #10 on: June 23, 2007, 09:08 PM »

luckyCO and IG i'm very very grateful for the info and the webs maybe i'll have u when i'm through with me project Grin Grin Grin Grin Grin Grin
Dynast (m)
CODES TO PROCESS AND ANALYSE DATES
« #11 on: June 25, 2007, 01:18 PM »

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #12 on: June 25, 2007, 01:36 PM »

Please amake 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 String

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #13 on: June 30, 2007, 04:56 PM »

It seems we don't have any problems in vb6.0?
Dynast (m)
PROGRAM TO COMPARE AND PROCESS DATES
« #14 on: July 02, 2007, 12:01 PM »

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 for 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
Dynast (m)
Re: Post your Vb 6.0 Questions Here
« #15 on: July 02, 2007, 01:35 PM »

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 you're as well very generous with your 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]
luckyCO
Re: Post your Vb 6.0 Questions Here
« #16 on: July 02, 2007, 06:25 PM »

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

Josh4ever9
Re: Post your Vb 6.0 Questions Here
« #17 on: July 02, 2007, 07:23 PM »

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 don't want this to happen.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #18 on: July 03, 2007, 10:12 AM »

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.
luckyCO
Re: Post your Vb 6.0 Questions Here
« #19 on: July 03, 2007, 10:33 AM »

Dynast thank for your compliments.

Below are the comments but don't 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 don't 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 don't 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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #20 on: July 03, 2007, 05:22 PM »

Maybe I should think that nobody has any more problems in Vb 6.0.
Take care and bye for now.
Dynast (m)
Creating users account by an Administrator
« #21 on: July 10, 2007, 05:18 PM »

Please 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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #22 on: July 10, 2007, 05:50 PM »

Are u talking about writing a program, an independent or a program that will control authentication on windows Operating system?

make yourself more clearer
Dynast (m)
Re: Post your Vb 6.0 Questions Here
« #23 on: July 11, 2007, 03:26 PM »

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
Zule (m)
civil service payroll accounting system
« #24 on: July 16, 2007, 08:25 PM »

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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #25 on: July 17, 2007, 07:26 AM »

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 don't 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. You 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 can't help u.
Dynast (m)
Re: Post your Vb 6.0 Questions Here
« #26 on: July 17, 2007, 05:05 PM »

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 through 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
luckyCO
Re: Post your Vb 6.0 Questions Here
« #27 on: July 17, 2007, 05:43 PM »

Dynast what do u mean by System? Do u mean your own program or Operating system?

If system u mean is your own program then tell me the backend(database ) you want to use such that I can write the program for u
Zule (m)
Re: Post your Vb 6.0 Questions Here
« #28 on: July 17, 2007, 09:38 PM »

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
please don't hesitate to inform me
neeyee (m)
Re: Post your Vb 6.0 Questions Here
« #29 on: July 18, 2007, 06:39 AM »

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.
Dynast (m)
Re: Post your Vb 6.0 Questions Here
« #30 on: July 18, 2007, 02:12 PM »

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"
luckyCO
Re: Post your Vb 6.0 Questions Here
« #31 on: July 18, 2007, 08:01 PM »

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.




BLOB.rar
* BLOB.rar (132.44 KB - downloaded )
 Companies not giving IT Projects to Nigerians  Dreamweaver vs FrontPage  Database Administrators On Nairaland  Page 2
Pages: (1) (2) (3) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Jobs (2) Career Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Powered by: SMF, © 2001-2005, Lewis Media. All Rights Reserved.