Monday, May 24, 2010

Is there a way to determine if a computer is a laptop or desktop using visual basic 6?

before I make the migration over to visual basuc 2005, I would like to know if there is a piece of code out there anyone is willing to share with me to determine if there is a way a computer is a desktop or a laptop using visual basic 6.


Any ideas?


Thanks

Is there a way to determine if a computer is a laptop or desktop using visual basic 6?
no. the system information of a computer don't reveal that. neither do ip


What is the extension of visual basic projects?

i want to retrievevisual basic projects from the system using search option. when i give *.vbp this also retrives vb.net projects. this gives me great problem. how to retrieve only vb projects. please help me.

What is the extension of visual basic projects?
.vbp


How do I access a midi keyboard from visual basic 2005?

I want to be able to interact with a midi keyboard in either vb6 or vb2005. Any ideas?

How do I access a midi keyboard from visual basic 2005?
unfortunately there is not a namespace in VS that can be used for MIDI or any other more complicated sound playing or compression use.





I am almost finished with a .dll that will be able to compress, transmit, playback and save sounds. Its a serious app and very difficult to set up. Lots of reading for the api functions is needed.





If you are familiar with API functions I would be more than willing to work on this project with you so that you can create your own MIDI dll.





It should take about a week of reading and programming to create.





Give me a shout on yahoo IM:


my screen name is :ebred

playing cards

How do you load a second form in Visual Basic?

I'm trying to make a program for an online game i play to show the world map. It opens the first form with the main map and I want to be ablke to click on an image of say, an arrow, to go to the right. I made another form with what would be to the right but i can't figure out how to load that second form and get rid of the first one. any help appreciated. thanks.

How do you load a second form in Visual Basic?
(VB5/6) A simple way would be:





button_click() 'whatever you named the event button


form1.hide


form2.show





end sub





Change the form names to whatever you named them.
Reply:OK; first I asume you created a form class like this:





class Form1: Inherits System.Windows.Forms.Form


public sub new()


Me.size=new Size(400,400)


Me.FormBorderStyle = FormBorderStyle.None


Me.StartPosition=FormStartPosition.Cente...


Me.ShowDialog()


end sub


end class





Then you create


class Form2: Inherits System.Windows.Forms.Form


public sub new()


Me.size=new Size(400,400)


Me.FormBorderStyle = FormBorderStyle.None


Me.StartPosition=FormStartPosition.Cente...


Me.ShowDialog()


end sub


end class





Then you instantiate Form1: dim f1= New Form1()


And when you want to get rid of this use this code:





f1.close()


then you show the second form:


dim f2= New Form2()





I hope it helps!
Reply:Do a .Hide and .Show to your two forms as another poster has already explained.





If you want the first form to still exist, but not be clickable, then when you do a .Show on the second form, add vbModal to the end, which means that the first one won't be clickable until the second form closes.





Hope this helps, best of luck to your project!


What is the best Microsoft Visual Basic 2005 tutorial that is free and available online?

I'm currently doing my internship and i need to brush up on my C#, so does anyone know where i can find free tutorials for Visual Studio 2005? ASP.NET 2.0 btw.. Cheers..

What is the best Microsoft Visual Basic 2005 tutorial that is free and available online?
i dunno about tutorials... i know of a few sites to get really good eBooks...


What is the generic symbol for the root directory in visual basic?

how can I indicate the root direcotry in a file path description when writing a visual basic macro?

What is the generic symbol for the root directory in visual basic?
You can try using the tilda ~ to indicate the current path as





~/mySub/myProgram.exe


this would indicate to use the subdirectory from the current application path





Or you can use the application object and extract what path info you need. This code extracts the root of the current dirve based upon the application path string





Private Sub cmdDir_Click()


Dim appPath, appRoot As String


Dim ay() As String





appPath = Me.Application.Path


ay = Split(appPath, ":")


appRoot = ay(0) %26amp; ":\"





End Sub
Reply:you should use a function wich shows the root directory


get help from MSDN


How to change a read-only property to a property that can be changed (Visual Basic 2005 Express)?

For example, the size, font family, etc. of Textbox1. The compiler keeps telling me they're read-only. How to make them changable?

How to change a read-only property to a property that can be changed (Visual Basic 2005 Express)?
You can in fact change Font properties at run-time. However, you cannot do it the same way as you did in Visual Basic 6.





In Visual Basic .NET, fonts are read-only at run-time — you cannot set the properties directly, but you can assign a new Font object:


_______________





' This next statement generates an error—property is read-only.


TextBox1.Font = Arial





' These next two statements are the correct way.





' Assign a Font object—Name and Size are required.


TextBox1.Font = New System.Drawing.Font("Arial", 10)





' Assign additional attributes.


TextBox1.Font = New System.Drawing.Font(TextBox1.Font, FontStyle.Italic)





' Note: The Answers Editor does not always properly display information that is placed within parentheses.


' It sometimes truncates the enclosed expression.





' Please replace the above truncated parameters with:


' TextBox1.Font, FontStyle.Italic





_______________________________
Reply:The values in the properties are members they are read only at run time; however, you can assign a new object of the property type to you control.


In order to change certain properties at run time you have to: 1) create an object of the type of the property. 2) make changes to the values. 3) then assign the new object to the control.


Here is a simple sample I wrote. On the click of the button the size and font of the text box changes. The size of the button also changes.





Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim size As System.Drawing.Size


size = TextBox1.Size


size.Width = size.Width + 50


TextBox1.Size = size





size = Button1.Size


size.Height = size.Height + 200


Button1.Size = size





Dim f As System.Drawing.Font


f = New System.Drawing.Font("Comic Sans MS", 10, FontStyle.Bold)


TextBox1.Font = f


End Sub

graphics cards