Sunday, August 2, 2009

How to put your program, created in Visual Basic 6 on notification area from Windows XP?

I want to create a program and put it, when is openned on the notification area in Windows XP!

How to put your program, created in Visual Basic 6 on notification area from Windows XP?
Very easy to do .... in VB.net, which in 2008 you should be using already and not VB6. Then you could just drop a NotifyIcon control.


How to change a property in Visual Basic .NET 2005?

I'm using Visual Basic, and I'm just wondering, how do I add a property? Like, when I make a button, it has a text field, a size field, etc. Can I make my own field ti be included in the Properites window? (And if so, do I need to do it by programming?) Thanks.

How to change a property in Visual Basic .NET 2005?
No, you can't add a property. A text field is what's called a control, and the properties of a control are defined when the control itself is implemented.





It sounds like the easiest way to do what you want is just to add one or more variables to your program to keep track of the information you need.





If you give more details of what you're trying to do, people will be able to provide more detailed help.

rose garden

What is the best way to learn visual basic?

Dont go to learn anywhere. Software development for a beginner %26amp; intermediate is just stealing programs from someone and manipulate those programs. I would suggest you that dounload some tutorials and source codes and manipulate them. This way you can learn and try some new things. My dear friend professionals from all over the software companies in the world follow this procedure. Practising more you learn more.

What is the best way to learn visual basic?
buy a visual book and do it with the book and come up with some programs. I did a few and also made some freeware..
Reply:I would buy a book and learn from there. Online ones are okay, but books are better for me at least.
Reply:classes


Why doesn't Vlookup work with visual basic?

I can enter a vlookup formula into a cell using visual basic. The problem is that the cell doesn't return a value that makes sense until I select the cell %26amp; hit enter. This defeats the purpose of using vb in the first place. Any ideas?

Why doesn't Vlookup work with visual basic?
Try moving your code into the onChange() event handler.
Reply:This is an Excel Question not VB.


Is there an easy way to make a calculator using visual basic 2008?

It just needs the following operations : Addition, subtracton,dividing,multiplying,decimals and negatives.

Is there an easy way to make a calculator using visual basic 2008?
For a seasoned programmer, I'm sure recreating the wheel (ie writing yet another calculator program) would be easy enough.





You just have to understand each operation, what you want each button to do, and what exactly you want to display.





The idea here is to break everything down to it's simplest components.





In VB.NET, everything is an object with properties, procedures, etc. What exactly should happen when you hit the button with the image of the "+" sign (or any other sign, such as the "-" sign)? What exactly should happen when you hit the button that represents the "Enter" key? How do you plan to deal with division by zero so the program doesn't crash? What will you do if there is an overflow in the math? Remember to include a "Clear" button. Perhaps the "Esc" key can double as a "Clear" button. Will you allow parenthesis for more complex calculations? How about a "Mem" button to save the display in a single-memory storage?





There's a lot to think about, and you must take it one little step at a time.





Don't try to program the entire calculator all at once.





First start with the visual image and layout of the calculator, with all the necessary buttons, then concern yourself with only one button at a time.





Good luck :-)


I want to learn visual basic online without any cost. Is there any site for this?

I want to learn Visual Basic 6.0 online and free of cost but I can not find any site for this. Please help me to find a best free learning site for Microsoft visual Basic 6.0. thanks

I want to learn visual basic online without any cost. Is there any site for this?
http://www.hitmill.com/programming/vb.ht...





http://highered.mcgraw-hill.com/sites/00...





http://www.freeprogrammingresources.com/...





http://msdn.microsoft.com/vbasic/





http://msdn.microsoft.com/vbrun/





http://www.techtutorials.info/vbasic.htm...





http://vyaskn.tripod.com/vbres.htm





http://www.vbexplorer.com/





http://www.mvps.org/vbnet/index.html?http://www.mvps.org/vbnet/links/personal...
Reply:www.codeguru.com is the best choice


additionaly search on Google and askjeeves for the same.





if nothing works... contact me "googlygigs@yahoo.com" and i will send u some best ebooks from microsoft press

pink flowers

In visual basic how would I make Form1 open up to Form2.?

In visual basic how would I make Form1 open up to Form2?


For example, if I wanted an application to open a help menu by clicking a "help" button.

In visual basic how would I make Form1 open up to Form2.?
You select your help button in the forms designer. Then add to it a message handler to click event. VB will write an empty sub for doing that -probably something like "sub helpbutton_click"


Inside it you write the code, which can be this for Form2:





dim F2 as new Form2()


F2.ShowDialog()
Reply:in form 2 use the any command buttons or textbox type following commands





for example





dim a


private sub command1()


a=form1.show


msgbox " Hello welcome to Form1"


end sub


Why doesn't my Visual Basic 6 database application with DAO work anymore?

I made a database application in Visual Basic sometime around 2002 on a machine running Windows 2000 and Office 97. I'm now on Windows XP with Office XP. It uses DAO (current ver 3.51) and Data Bound List Controls (current ver 6.0). I don't know which versions of these I used when I compiled it back in 2002. The compiled version works fine. But now when I recompile it with only cosmetic changes it doesn't work. When it updates a record, it puts the information in the wrong field! Is there some simple fix? Do I need to load earlier versions of something? Or can someone point me to a website that describes how to fix my application to work on WinXP with Office XP.

Why doesn't my Visual Basic 6 database application with DAO work anymore?
'm not positive but I believe Office XP no longer supports DAO...using ADO instead. If your VB6 application hits an Access97 database it will work fine, but hitting any Access version after that will be problematic. Try loading an Access97 version of your db.
Reply:DAO still works... MS Office 2000 and up need version 4.0


How can I make a text box in VISUAL BASIC ignore spaces and special characters?

I need to do this without entering all the special characters into the program. Is there a shortcut or somthing that can help me do this?

How can I make a text box in VISUAL BASIC ignore spaces and special characters?
Look into the the following events for the textbox :





KeyDown


KeyPress


KeyUp





See the following link and how to manipulate these events to your specs. You will also need a hex/dec/ascii chart. Search the web for that, although I do believe s space char is ascii 20.





Link : http://msdn.microsoft.com/library/defaul...





Just program for the char range you need to use A-Z(Ascii 65-90) and a-z(Ascii 97-122) and 0-9(Ascii 48-57), everything else set to KeyCode = 0 (nothing).








Good luck!
Reply:its a program for programming, u have to put the special characters for programming


How can I bold a single word in Excel using Visual Basic?

Microsoft has turned MSDN upside down again and I can't find anything. Those idiots are always re-working MSDN and right now half of Excel is missing. Microsoft's motto seems to be: If it ain't broke, break it.





I need to bold a single word in a cell using Visual Basic. I know how to do it in Excel manually, but I need to be able to program it.





Thanks





Steve

How can I bold a single word in Excel using Visual Basic?
That was correct but not clear





it goes like this





Sheet1.Range( "A1").Characters( 4, 5).Font.Bold = True





Sheet1: is the name of the Sheet in VBA (Not caption)


4: is the number of charactor to start bold from


5: is the length of the text you want it to be bold





You can also use "Underline", "Italic", "Size", etc





Enjoy my profile, I am the VBAXLMan
Reply:With ActiveCell.Characters(Start=10, Length=4).Font


.FontStyle = "Bold"


End With








-------








Where 10 is the location of the first letter and 4 is the length of the word. Not sure why it is showing elipses after the 10, but that should be a comma.

night garden

Using Visual Basic .NET how do you make a text box perform a function when enter is struck?

I want to be able to type something into the text box, hit enter, and watch as it does whatever it would have done had I clicked the button beneath it. Isn't there a really easy way to do this? I asked this about JavaScript before and still don't know how to do it with either.

Using Visual Basic .NET how do you make a text box perform a function when enter is struck?
i cant understand exactly what u mean but





Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp


If e.KeyCode = Keys.Enter Then


'do sth


End If


End Sub


Visual Basic 2005 Express: how to set a form to be the first to show when the program is loaded?

It is always Form1. How can I set the program to start from form 2 for example?

Visual Basic 2005 Express: how to set a form to be the first to show when the program is loaded?
From the top menu bar:





Project


nameOfYourProgram Properties...


select the form you want to run at startup under "Startup form:"
Reply:Follow these:


Project%26gt;"YourProject properties%26gt;Application Tab %26gt; Startup object


How can i interface a Visual Basic 6.0 to 7447 Decoder using parallel port.?

i need help!, im trying to interface a IC decoder 7447 to visual basic using parallel port. When i run it, suddenly their is a pop- up error coming from visual basic. here is the pop error..





AppName: vb6.exe AppVer: 6.0.81.76 ModName: inpout32.dll


ModVer: 0.0.0.0 Offset: 00005c0b





my OS is micrsoft service pack 3 and already have an inpout32.dll





here is my SoureCode and Module





Private Sub Command1_Click()


If Len(Text1.Text) = 1 Then


Out%26amp; H378, Asc(Text1.Text)


ElseIf Len(Text1.Text) = 0 Then


MsgBox "Input a Character!!", vbCritical, "Error"


Text1.SetFocus


Else


MsgBox "you should input only one character!", vbCritical, "Error"


Text1.SetFocus


End If


End Sub





Private Sub Command2_Click()


Out%26amp; H378, 0


Text1.Text = " "


End Sub





Module





Public Declare Function Inp Lib "inpout32.dll" _


Alias "Inp32" (ByVal PortAddress As Integer) As Integer


Public Declare Sub Out Lib "inpout32.dll" _


Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)

How can i interface a Visual Basic 6.0 to 7447 Decoder using parallel port.?
Don't know if this will help but you have "out%26amp; H378". Does this matter? Shouldn't it be "out %26amp;H378"?


Whats the difference between Visual Basic 6 and Visual Basic 2008?

Is VB 2008 just an updated version? Thanks

Whats the difference between Visual Basic 6 and Visual Basic 2008?
Visual Basic 6 develops COM+ applications. Visual Basic 2008 develops .NET applications. The two technologies are entirely different, to the extent that eventually, you won't be able to run COM applications in Windows.
Reply:MANY updated and NEW API's





2008 May not compile old code as many API's are no longer available......

flower bouquet

To be able to learn ms access, do we have to learn visual basic as well?

i'm planning to take ms access course, but i don't know how to use visual basic, will it be ok? or i will have to learn both at the same time?

To be able to learn ms access, do we have to learn visual basic as well?
The short answers:


NO, You don't need to learn VB to learn MS ACCESS.


Yes, You will be OK learning JUST MS ACCESS.


It wouldn't HURT You to learn the scripting side at the same time, though you shouldn't need to (I havn't seen your course work, they may make You).





The long answer:


MS Access was designed for the novice user to learn quickly %26amp; begin using for basic development WITHOUT having to learn SQL (Standard Query Language - pronounced "sequel") or a scripting language (like VB). That's why it's so heavy in GUI (Graphical User Interface - Pictures instead of words).





A variation of VB (called VBA) is used for advanced scripting of MS ACCESS. There is enough difference between the 2 languages that there are different books about developing in VBA instead of VB.





I have seen pretty extensive DBs built without using ANY custom VBA code, since Acccess "MACROS" can be written through a "CGI" and they generate simple scripts in VBA for You.





Hope all this helps!
Reply:Visual basic is the underpinning of MS Access. If you want to be able to do anything remotely useful you'll have to learn it. SO, to answer your question directly. Yeah, learn it at the same time...
Reply:As you talked about VB and MS Access, I recommend you the following website





http://www.freetutes.com/VisualBasic


Any good freelancer visual basic programmers looking for work?

Yes.





You could email me. However here are a couple of places to also look, if you need help finding staffing.





http://www.sologig.com


http://www.rentacoder.com





best wishes...

flower delivery

Adding in hotkeys in a Visual Basic program?

What line of code or whatever do I need to enter inorder to assign a hotkey to a button in visual basic? As in, if I have a button called 'quit' and I want them to be able to close the program by pressing Q (or whatever combinations are necessary) how would I code that in to the buttons code?

Adding in hotkeys in a Visual Basic program?
http://msdn2.microsoft.com/en-us/library...
Reply:Just add an Ampersand into the Command button caption ala:





E%26amp;xit = hitting X with execute this command button if the form has focus


What is the difference between Visual Basic 6 Enterprise and Professional?

Enterprise Edition includes step by step instructions for how to take advantage of Windows 2000 features, Integrated Enterprise tools to implement databases into applications, Microsoft SQL Server 6.5 Developer Edition, Visual Modeler, and Microsoft Visual SourceSafe 6.0. These are not contained in Professional Edition.

What is the difference between Visual Basic 6 Enterprise and Professional?
I've been using professional for 5 years now, and I've seen enterprise edition too, i think there's no big difference, it might differ in some unnecessary tools that's all


What are the required elements for writing a line of code in Visual Basic?

Please list and describe the necessities to write a line of code,


thanks.

What are the required elements for writing a line of code in Visual Basic?
http://msdn2.microsoft.com/en-us/library...
Reply:To write any given line of code successfully in Visual Basic you must know the proper syntax for a command (or statement). Visual Basic.Net (and all the .Net languages) are good in this regard in that any improper lines and their cause are noted even before you attempt to build the project.
Reply:It depends on what you are going to be coding...it's different if you want to perform a calculation or if you want to just add a comment.
Reply:http://www.ebay.ph/viItem?ItemId=3301535...


How do I make a lottery program in Visual Basic?

It needs to generate seven random numbers and sort them. Any help would be greatly appreciated.

How do I make a lottery program in Visual Basic?
To generate the random number you can use the inbuilt function Rand() or Rnd()





Use this line of code. This will generate a seven digit random number:


num = CLng((10000000 - 1 + 1) * Rnd + 1)


where num is ur seven digit random number

wholesale flowers

How to make visual basic mini golf?

Can anyone help write/ get me the code for mini golf in visual basic 6...i cant find it anywhere..thanks!

How to make visual basic mini golf?
What Rawlyn said. And here is a link to help get you started with games programming in VB :





http://www.vbexplorer.com/VBExplorer/gam...





Good luck!
Reply:There isn't a "magic code" - that's why you can't find it. If you want to program a golf game, then you need to _program_ it. Here's how you should approach the project:





1. Design the program.


2. Write the program.


3. Test the program.


4. Fix errors and bugs, return to 3 until finished.





Programming is not the art of downloading code - it is the art of writing code.





Rawlyn.


Microsoft Visual Basic 6- What does the align feature on the format menu do?

This is for my VB programming class- it just started and we haven't actually used the program yet.


Also, can you interchange semicolons and commas in VB?

Microsoft Visual Basic 6- What does the align feature on the format menu do?
It aligns the controls inside the form that is currently open.








You can't interchange semicolons and commas.
Reply:it aligns all the controls that are selected to how you want as there are a few different alignment commands in the format menu ie align horizontally, align vertically, align to the left, align to the centre, align to the right.





WIth regards to interchanging semicolons and commas , do you mean if you had a string can you programatically change them or what exactly ?
Reply:The align section of the properties menu actually centers what is in the control. For example, if you have a label and you set the align property of that label to Left Justified, all of the text within that label will start from the far left. If you set it to Centered, it will center the text in the middle of the label.





As for the code, there aren't a lot of instances where you'd use a comma in the beginners stages, but if you did it could not be replaced with a semicolon. You would use a semi-colon in multi part lines of code, like a database connection string for example. However, again you could not replace this with a comma.


How would I make a shape move using arrow keys in Visual Basic?

I would like it to move a a pixel or two each time. I understand I need to use vbKeyUp, vbKeyDown, vbKeyLeft, vbKeyRight, but I don't understand how I am supposed to write the code. Say I am using Shape1 as the object I would like to move. What code do I have to write? Under what private sub? I need to introduce Keycode as integer? Why?

How would I make a shape move using arrow keys in Visual Basic?
Hi,


Put a shape on the form and write the following code:


--------------------------------------...


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)


'for going left and right


If KeyCode = 37 Then Shape1.Left = Shape1.Left - 10


If KeyCode = 39 Then Shape1.Left = Shape1.Left + 10





'for going up and down


If KeyCode = 38 Then Shape1.Top = Shape1.Top - 10


If KeyCode = 40 Then Shape1.Top = Shape1.Top + 10


End Sub


--------------------------------------...


How to make logic bomb using visual basic?

hey guys can u help me make a logic bomb using visual basic. simple instructions will do. if i open or run the program i made in visual basic what codes should i use to terminate it in 10min or delete its database or just delete its own?

How to make logic bomb using visual basic?
Answering your question would not only be considered illegal in many countries, but doing so would be stupid.





advice: learn VB and learn the OS you want to implement it on

state flower

How do you use keypress comands in visual basic?

I have worked with command click buttons but I don't know how to execute the lines of code in my command subscipts by pressing a key board button or how to set the key you need to press. I know very little about keypress comands so be specific.

How do you use keypress comands in visual basic?
see there are three Events from the keyboard which can read ASCII Code of the each key


1%26gt; KeyPress (Argument is ASCII)


2%26gt; Key Down


3%26gt; Key Up





Private Sub TextBox1_keyPress(keyAscii as integer)





end sub





When ever you will press any key the ASCII Code will go in.For example the ASCII code of "A" is 65


and 66 for B , 67 for C so on


and 97 for "a" and 98 for "b" and so on and 13 for enter , 32 for space.and for numeric it is 48 for "0" and 49 for "1" and 57 for "9"


suppose for a TextBox If I want to restrict the user not to use the space then I can write like this





private Sub TextBox1_keyPress(keyascii as integer)


if keyascii= 32 then


keyascii=0


end if


end sub


Means whenever in a TextBox , user will press space then It will set keyasii to zero so space won't enter in the text box. Suppose in a RollNo TextBox you want to restrict the alphabets then





private sub RollNoTextBox_keypress(keyascii as integer)


if keyascii%26gt;=65 and keyascii%26lt;=90 then


keyascii=0


end if


if keyascii%26gt;=97 and keyascii%26lt;=122 then


keyascii=0


end if


if keyascii=32 then


keyasii=0


end if


end sub





This code means if a person will enter A-Z or a-z or space(32) then it won't let them enter.


If you wnat to know the Ascii code of any character then simply write this programm





private sub TextBox1_keypress(keyasii as inetger)


msgbox keyAscii


end sub





whatever key u will press it will display the ascii character.


similarly if for uppercase





private sub TextBox1_keyPress(KeyAscii as Inetger)


if (keyAscii%26lt;=97 and keyascii%26gt;=122) then


keyascii=keyascii-32


end if


end sub





Like if anyone will press "a" code is 97


then it will do 97-32=65 and 65 is code for "A"


so all small letters will be changed to uppercase.





May be this helps.


for ascii code u can also see


http://www.december.com/html/spec/ascii....





if required do write for keyUp and key down.


better install MSDN for help.


How do I enter a value of a cell in an inputbox prompt in Visual Basic?

Example:


Let's say that cell A1 has a value of 80 in it.


How do I write the code for the prompt in an inputbox to comeout like:


"You have 80 cookies"


where the value 80 is a variable and it depends on the value on the cell A1.

How do I enter a value of a cell in an inputbox prompt in Visual Basic?
Try this:


Range("a1").Select


c_value = Trim(ActiveCell.Value)


msgbox ("You have " %26amp; c_value %26amp; " cookies")
Reply:yellow_taxi Is this you? … :)!


http://www.osoq.com/funstuff/extra/extra...


How to open favorites files in visual basic ?

hi


did any one know how to open *.url* file(favorites file) in the webbrowser tool in visual basic ?





thanks

How to open favorites files in visual basic ?
1. Start a new Standard.Exe project.


2. With the Form outline on the screen.. from the VB Menu.. click on Tools - %26gt; Menu Editor and add a menu structure like so.





Key "Caption"





mnuFavorites "Favorites"


mnuAdd "Add"


mnuDelete "Delete"


mnuDltNone "NO Delete"


mnuDlt(0) "Dlt(0)" %26lt;-- Set Visible = False


mnuURL(0) "URL(0)" %26lt;-- Set Visible = False





3. Copy and Paste the code below into the Form code window.


4. Press F5 to run. Click on the Menu Bar or mouse click on the form for the Menu to show.





%26lt;---- Code Begin -----%26gt;





Option Explicit





Private m_intMenuFavorites As Integer





Private Sub Form_Click()





PopupMenu mnuFavorites





End Sub





Private Sub Form_Load()





m_intMenuFavorites = 5


Call xMenuAdd("A", "A")


Call xMenuAdd("B", "B")


Call xMenuAdd("C", "C")


Call xMenuAdd("D", "D")


Call xMenuAdd("E", "E")


Call xMenuAdd("F", "F")





End Sub





Private Sub mnuDlt_Click(Index As Integer)





Dim intIndex As Integer


intIndex = MsgBox("Are You Sure You Want To Delete This Favorite?" _


%26amp; vbCrLf %26amp; vbCrLf _


%26amp; mnuDlt(Index).Caption, _


vbOKCancel, _


"Favorite Place Delete")


If intIndex = vbCancel _


Then


Exit Sub


End If





For intIndex = Index To mnuUrl.UBound - 1


mnuDlt(intIndex).Visible = mnuDlt(intIndex + 1).Visible


mnuDlt(intIndex).Caption = mnuDlt(intIndex + 1).Caption


mnuDlt(intIndex).Tag = mnuDlt(intIndex + 1).Tag


mnuUrl(intIndex).Visible = mnuUrl(intIndex + 1).Visible


mnuUrl(intIndex).Caption = mnuUrl(intIndex + 1).Caption


mnuUrl(intIndex).Tag = mnuUrl(intIndex + 1).Tag


Next intIndex


mnuDlt(mnuDlt.UBound).Visible = False


mnuUrl(mnuUrl.UBound).Visible = False





End Sub





Private Sub xMenuAdd(ByVal strCaption As String, ByVal strTag As String)





If mnuUrl(0).Visible = True _


Then


If mnuUrl.Count %26lt; m_intMenuFavorites _


Then


Load mnuUrl(mnuUrl.Count)


Load mnuDlt(mnuDlt.Count)


End If


Dim intIndex As Integer


For intIndex = mnuUrl.UBound - 1 To 0 Step -1


mnuDlt(intIndex + 1).Visible = mnuUrl(intIndex).Visible


mnuDlt(intIndex + 1).Caption = mnuUrl(intIndex).Caption


mnuDlt(intIndex + 1).Tag = mnuUrl(intIndex).Tag


mnuUrl(intIndex + 1).Visible = mnuUrl(intIndex).Visible


mnuUrl(intIndex + 1).Caption = mnuUrl(intIndex).Caption


mnuUrl(intIndex + 1).Tag = mnuUrl(intIndex).Tag


Next intIndex


End If





mnuDlt(0).Visible = True


mnuDlt(0).Caption = strCaption


mnuDlt(0).Tag = strTag


mnuUrl(0).Visible = True


mnuUrl(0).Caption = strCaption


mnuUrl(0).Tag = strTag





End Sub





%26lt;----- Code End -----%26gt;


How do i create an excel macro language with visual basic to exit the program?

i know how to get to visual basic when editing a macro with code in visual basic, or along the lines of that anyway, i just can't remember what the piece of code was. i have to do this command to pass my assignment and it's the last thing i need to do and its due in tomorrow so all help is much appreciated as quickly as possible please?


thanks to all in advanced


marky j

How do i create an excel macro language with visual basic to exit the program?
Assume you have only 1 workbook open


Sub closeExcel()


      Application.Quit


      ThisWorkbook.Saved = True


      Exit Sub


End Sub


Hope this helps.
Reply:One I have starts with Sub Macro1 () and ends with Exit Sub - before exit there is a Application.Goto Reference:="R21C1" where calculated results start.
Reply:the command you need to put in your macro is





application.exit

song meanings

How can you make highschool students be motivated to learn Visual Basic?

Visual Basic is very powerful in its GUI compared to other programming languages. Make a simple but interesting program, put nice photos/ pictures, and run the demo in front of the class. Most of them will be excited about it.

How can you make highschool students be motivated to learn Visual Basic?
I am currently taking a vb class in high school. I can tell you from personal experience book work it NOT the way to go!!! Make a interesting program. That can be used at home. I would try to steer away from IO declarations, because I don't know that the system.permissions.security.IO allows it.


How to create a timer in Visual Basic 6?

I know how to create a timer using the timer control, but don't know how to get it into the proper format. So what I'm saying is that I don't want the time displayed to be 126 seconds, but 2 minutes and 6 seconds. Any (easy) way to do this? Any help appreciated.

How to create a timer in Visual Basic 6?
i converted this from my C# code. Since i dont have visual basic 6 anymore, i just whiped this up from memory. Sorry if it doesnt compile directly. Use the visual basic 6 mod function to get the remander of seconds from seconds / 60


example:


iSecondsRemaining = iSeconds mod 60











Function ConvertTime(iSec as Integer) as String


'convert the time to 00:00 format


iMinutes as integer = 0


iSeconds as integer = iSec


sSeconds as string





'calculate


iSeconds = iSec mod 60 '(use the mod function)


iMinutes = iSec /60





'format


sSeconds = str$(iSeconds)


if (len(sSeconds) = 1) then sSeconds = "0" %26amp; sSeconds


Function = Str$(iMinutes) %26amp; ":" %26amp; sSeconds


end function
Reply:Public Function SetTimeFormat(ByVal TimeValue As Double)





On Error GoTo errorhandler


seconds = Fix(TimeValue)


mins = Fix(TimeValue / 60)


secs = TimeValue - (mins * 60)


If secs %26lt; 10 Then secs = "0" %26amp; secs


SetTimeFormat = mins %26amp; ":" %26amp; secs


Exit Function


errorhandler:


SetTimeFormat = "0:00"


End Function


What kind of program should I do for a visual basic project?

Alright I've got the balls for anything, give me all you got.

What kind of program should I do for a visual basic project?
Slot machine is a good idea, but might be too graphics intensive for a VB learner project...and under the business logic is very simple.





Try making a sudoku puzzle solver. Will deal with lots of various business rules, recursion, interesting UI work, object modeling, the works. Then see how fast you can make it. Would be a fun project.
Reply:do a slot machine.


How do I add something to an array in Visual Basic?

If I've already declared an array, what do I do to add more to it?

How do I add something to an array in Visual Basic?
You can use the incremental counter.


Make you you have a null reference after the array name. MyArray()





Dim MyArray() as String, Counter as Integer = 0





MyArray(Counter) = Counter


Counter += 1





OR





You can do this





MyArray(MyArray.Length() ) =MyArray.Length() .ToString





OR whatever you want
Reply:Dim a





a=Array(1,2,3)





b = a(0) ' b is now 1


b = a(1) ' b is now 2





ReDim Preserve a(4)





a(3) = 4





b=a(3) ' b is now 4

pollen

Simulating a combination lock in Visual Basic. How do I make the angle change the stage of the lock?

What it's like is there is one point that changes instantly changes the angle in relation to lock values from 0 to 59 or from 59 to 0, depending on the direction. this is what is causing my problem. I have a label that indicates the stage of the lock that of course will be removed later.

Simulating a combination lock in Visual Basic. How do I make the angle change the stage of the lock?
set up a select





select angle


case 1-90: lockvalue = 1


case 91-180: lockvalue = 2


case 181: .....etc...


end select


How best to remove hyperlink from a group of cells from an Excel worksheet without using Visual Basic?

I can remove it one by one, but if there are too many cells it can be so tedious.

How best to remove hyperlink from a group of cells from an Excel worksheet without using Visual Basic?
Fastest way to do this is as follows:





1) Select cells that contain hyperlinks


2) Ctrl+C to copy the cells


3) Maneuver to a blank area of sheet.


4) Paste VALUES. Click EDIT, Choose PASTE SPECIAL, choose VALUES, click OK.


5) Format the newly-pasted values to your liking.


6) Select the newly-formatted cells


7) Copy cells


8) Manuever back to original cells


9) Paste


10) Enjoy your new data without those pesky hyperlinks!





Hope this helps.





Regards,


QwertyKPH @ Yahoo!
Reply:What do you mean?


Select them all (Hold down on first one) and then hold down CTRL while pressing the rest, then delete them





Is that what you asked for?





XLMan
Reply:Just record a macro, you can do this without having to edit or add any visual basic, start recording in the cell you want to start in, right click or hit the alt menu key, choose remove hyperlink, and hit the down arrow, then stop recording.





Make the macro a button then you can start at the top, and click the button for each one, much faster than the other way or use a keyboard combination and just rapid click it.


How do I go about making an array of a deck of 52 cards in visual basic 2005?

I need to be able to have the user select cards.

How do I go about making an array of a deck of 52 cards in visual basic 2005?
Ok...so what do you want?


Dim cards(52) as String, done(52) as Boolean





For counter as Integer = 1 to 52


cards(counter) = counter


Next





You will have to do a loop through all of the cominations, (flush, strait ect ect).





Put the selected cards in an array, use a array.sort, then a For...Next loop to test the user array (selected cards), with the controlled array(cards to be tested).


If the user selects the card, have the boolean = True


How do I use CheckBoxes and RadioButtons in visual basic?

Im working on my review for my final, and I have 2 textbooks. Neither include anything about these two.

How do I use CheckBoxes and RadioButtons in visual basic?
lol exactly what do you want to use them for?


be more specific, VB6.0 or VB.net?


in which way do you want to use them





then i can answer your question :)





yes it does help


you need to hook up their events like any other vb control


for checkboxs, you want to hook the CheckChanged event into a function (which you can get the state the checkbox was changed to by checkBoxName.Checked )





for a RadioButton, only one in each 'group' can be selected, and you want to do the same as with a checkbox (hook the CheckChanged event into a function, with a radiobutton you can hook all into the same function, and use radioButtonName.Checked to check the state of each radiobutton to find which is checked)





i hope that helps?


if you need more help just send me a message
Reply:The best Way for you is the MSDN of Microsoft,in that sarvice you can find every thing From A to Z.


WWW.MSDN.Microsoft.com
Reply:Comboboxes allow you to provide a list of answers that a user can select from. You can also allow users to add to the list.





Example: State Selection - The users selects what state they live in from a list of available states. Prevents 30 different spellings for one correct answer.





Rabio Buttons are used to allow a user to slect one answer from a limites set of choices.





Example: Export format - The user wants to run a report, but you want to know what format they want the report ran in; Excel, PDF, text file, etc. You have limits to what export formats your program can support, so you limit the radio options to only those that are available, and that is normally a short unchangeing list.

playing cards

How does one become a Web Developer using Visual Basic 2005?

I need to be pushed in the right direction. I've taken some VB 2003 classes in the past and now I would like to code as a career. I want to know what I exactly I should study to have the skills to compete. I'm leaning towards database design.

How does one become a Web Developer using Visual Basic 2005?
You don't. You learn a real web programming language.
Reply:1. Start HTML development by using notepad or dreamweaver. Eclipse with the web tools package is also quite good (and free).





2. Get a book on HTML + get a book on Javascript.





3. Use your VB skills for developing back-ends. Learn some of the .net stuff relating to web services and serialisation. Try a certification course perhaps.





4. Try to find and follow a good MVC pattern for web development in .net. It's good to start this way so you don't develop too many bad habits.
Reply:I would take courseware (either MOC or other certifications) and keep reading. My books are not designed specifically for web development as it's aging technology. Yes, there are a lot of web applications being built, but if you're getting started, learn new technology. My latest book (see www.betav.com for details) addresses database design and implementation fundementals. I expect it would help.
Reply:You need to know SQL, activex, ADO,ODBC, oracle, access, DHTML or XHTML, OLE DB API. etc. this is for Visual Basic 6. This may apply to visual basic 2005 too. Also visual basic 2008 has been released. check Microsoft.com.





if you want web programming try ASP(Active Server Pages), it uses VBscripting.


How can you load an image into a picture box on visual basic 6?

I am trying to load an image into a regular picture by somehow using the file address to tell the computer to load this image into the picture box. What is the syntax for this?

How can you load an image into a picture box on visual basic 6?
Picture1.Picture = LoadPicture(App.Path %26amp; ("filename.extention")
Reply:myPictureBox.Image = new Bitmap("MyBitmap.bmp")





that should be the easiest way...


Is there a way to automatically update a file name in Visual Basic on Excel?

BAsically, I have a VB programme that I want to use in a file, but users of the file change the name when they use it. I want VB to automatically change the filename in the code when the name of the file is changed. Is this possible?

Is there a way to automatically update a file name in Visual Basic on Excel?
If you wrote some code to get them to input the name of the file first then you could easily change it to write the file using the code and keep the new file name. Something like this:








filename = InputBox("what would you like to rename the file as")





Set myFSO = CreateObject("Scripting.FileSystemObject...


Set WriteStuff = myFSO.OpenTextFile("c:\" %26amp; filename, 8, True)


WriteStuff.WriteLine(whatever the new data is put the variable here)


WriteStuff.Close


SET WriteStuff = NOTHING


SET myFSO = NOTHING


How to make a visual basic program to record a 2 pin connection on a serial port?

I run a retail store and i would like to know how many people come into my store by counting number of door openings. Using a magnet switch on the door and running it to a laptops serial pins and writing a program to record it all. Any help would be thankful.

How to make a visual basic program to record a 2 pin connection on a serial port?
the serial port cant read a switch like that. the serial port expects 8 bits of data, with a start bit and stop bit, (total of 10 bits). also the baud rate needs to be set to a particular rate. that cant be done with just a switch.
Reply:check http://www.pscode.com for examples.
Reply:You use the MScomm tool (project%26gt;%26gt;components%26gt;%26gt;controls tab%26gt;%26gt;Microsoft comm control 6.0) to 'listen' to the serial port. After that it's a simple matter of counting the number of times a signal was received from the port. Maybe divide by 2 to account for coming and going of customers.

graphics cards

How do I create a calculator using visual basic that will automatically calculate without a button?

If I understand your question here's a quick way to achieve what's you're looking for.





Have 3 Text boxes on the screen


Text1.Text Text2.Text and Text3.Text





Numeric Values go into all boxes but for the first box you


would add the symbol of the operation you want and then when you move out of Text2.Text this will calculate your problem into Text3.Text





Text1.Text


Example: 25 +


Text2.Text


40


Text3.Text


65





Private Sub Text2_LostFocus()


If Val(Text1.Text) %26gt; 0 And Val(Text2) %26gt; 0 Then


FNum = Val(Text1.Text): SNum = Val(Text2)


If InStr(Text1.Text, "+") %26gt; 0 Then Text3.Text = FNum + SNum


If InStr(Text1.Text, "x") %26gt; 0 Then Text3.Text = FNum * SNum


If InStr(Text1.Text, "-") %26gt; 0 Then Text3.Text = FNum - SNum


If InStr(Text1.Text, "/") %26gt; 0 Then Text3.Text = FNum / SNum


End If





I hope this helps you......Owl


MS Excel + Visual Basic: How can I obtain the value of a cell into a variable?

For example, let's pretend in cell A1 the total value is 100





When I create a button in Excel, and Assign Macro (which opens up Visual Basic) , how can I get the value of the cell into a variable I declared?

MS Excel + Visual Basic: How can I obtain the value of a cell into a variable?
' //


' // Start Code


' //


Sub b1911()


szCell = Workbooks("Book1"). Worksheets("Sheet1"). Cells(1, 1). Value


MsgBox szCell


End Sub


' //


' // End Code


' //
Reply:I don't see my favorite way to refer to cells in the other answers:





dim MyA1Var


MyA1Var = [A1]





I capitalize the A for appearances. It works in any case.
Reply:Use either of the two below:





=Range("A1")


or


= Cells(1,1)





Note that when using 'Range' you have to use inverted commas, and hence cannot be used with a formula that returns the Rows or column numbers.





whereas when using 'Cells' you do not use any inverted commas and therefore is more versatile.


Cells(RowNum,ColNum)
Reply:oCell = Workbooks("%26lt;BookName%26gt;"). Worksheets("%26lt;SheetName%26gt;"). Cells(1, 1)
Reply:In your VBA code, write


Sub GetValue()


ThisWorkbook.Activate


Sheets("xxxx").select


myVar = Range("A1")


End Sub


Where xxxx is the name of the sheet on which you have the value in cell A1.





Further you can write msgbox "Value of my var is " %26amp; myVar to show a pop up message displaying the value of myVar.





Hope this helps


How do you get a pointer to a variable in Visual Basic 2008?

Pointers don't exists in VB6. I'm now using VB2008, and I don't know how to get the pointer to a variable!

How do you get a pointer to a variable in Visual Basic 2008?
Well, if you are passing this variable to a function it is pretty easy. Instead of using Byval x as Integer, use ByRef x as Integer.





Otherwise, it is much more difficult. Here is an article that might help





http://www.codeproject.com/KB/dotnet/poi...


How do i run an exectuable file in the background of my program once ive called it, using visual basic?

The executable im using is s-tools and i need it to be called and run in the background so that the user isnt aware it is using s-tools. at the moment, s-tools appears in the taskbar of windows and the user has to manually click it to open it, but i do not want them to see s-tools running at all.

How do i run an exectuable file in the background of my program once ive called it, using visual basic?
use minimized focus to run the exe in the background....


when u start





Call Shell("C:\WINDOWS\notepad.EXE", vbMaximizedFocus)





use vbminimisedfocus....... it will start the exe but in background.....

botanical garden

What is the closest language to Visual Basic, that can be be used to programme websites/databases?

I have learnt to programme in VB and would like to create a website linked to a database, whats the most similar looking/feeling language to programme to VB? ASP? PHP %26amp; Mysql?





Thanks in advance!

What is the closest language to Visual Basic, that can be be used to programme websites/databases?
Don't know pHp, but VB has helped me understand Ruby a bit more and vice versa. Weird, but that's my take on it. I have reservations about recommending Ruby on Rails/MySql, however.





Btw, VB .NET/ASP .NET isn't much different than VB/Classic ASP if you throw the entire event-model and code-behind paradigm out the window. It's not "recommended" by Microsoft and a few coding zealots but the argument against is hogwash if you know what you are doing.
Reply:PHP and MySQL by far.
Reply:PHP and mySQL. If you are looking for a hosting service I like to use http://www.000webhost.com


How to make buttons go to next page in Visual Basic 2008?

How do i make command buttons like, Next take me to the next form?

How to make buttons go to next page in Visual Basic 2008?
I usually do this by showing and hiding the forms.





For example:





Dim nextForm as New Form2


Me.Hide


nextForm.ShowDialog(Me)


Me.Show





I use ShowDialog so that execution of code will not continue until 'nextForm' is closed.


How do you convert binary numbers to decimals in Visual Basic 6?

I'm trying to convert binary numbers to decimals and vice versa. I can convert from decimals to binary, but how do you convert from binary to decimal?

How do you convert binary numbers to decimals in Visual Basic 6?
Check this url





http://www.planet-source-code.com/vb/scr...
Reply:http://www.vb-helper.com/howto_decimal_t...
Reply:Hope this will helps you





Function Bin(ByVal value As Long, Optional digits As Long = -1) As String


Dim result As String, exponent As Integer


' this is faster than creating the string by appending chars


result = String$(32, "0")


Do


If value And Power2(exponent) Then


' we found a bit that is set, clear it


Mid$(result, 32 - exponent, 1) = "1"


value = value Xor Power2(exponent)


End If


exponent = exponent + 1


Loop While value


If digits %26lt; 0 Then


' trim non significant digits, if digits was omitted or negative


Bin = Mid$(result, 33 - exponent)


Else


' else trim to the requested number of digits


Bin = Right$(result, digits)


End If


End Function