|
Look out this bro
http://www.vbcodesource.com/exampleEx.html
In VisalBasic Examples table example with name calculator that is what u need
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
Hi,
As already posted, there are thousands of tutorials and articles online about writing a calculator - many of these will be in VB, and a quick google search will find them. Knowing how to find things is a very important part of any job and you should learn this skill well.
Writing a calculator can be done very simply, ranging up to the very complex. It depends what you want to learn. As you are a beginner you should start by breaking the problem down into manageable steps.
A typical simple calulator goes like this
1) Obtain a number from the user (tot)
2) Obtain an operator (+,-,*,/) from the user (op)
3) Obtain a number from the user (input)
4) Execute operator on 2 numbers and store back in tot (tot = tot op input)
5) repeat 2) - 4) until op is '='
6) Output tot
I would suggest you try this in a console application before trying to build a GUI, also if you have studied OOP yet then try to incorporate this into it (think Calculator object, Operator object, Number object etc).
remember, this forum is for code-related queries, so when(if?) you encounter a problem coding this then do post the code, the problem you are having and any other relevant info and we shall try to help you out.
|
|
|
|
|
How can i write a media player (withOut Windows APIs) like windows media player ( please send a refrence)
MHF
|
|
|
|
|
take a look this bro
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=4582&lngWId=10
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
It is Goog but i want a program without using windows APIs
Thanks
MHF
|
|
|
|
|
Hi,
I am trying to implement updating using the ManualInProcQuickStart of the Updater Application Block 2.0. I am having a problem. My files are being downloaded to the "downloader" folder, they're not being copied to the folder I specified in my config file.. I have added activation processors as follows:
<activation>
<tasks>
<task type="Microsoft.ApplicationBlocks.Updater.ActivationProcessors.WaitForApplicationExitProcessor, Microsoft.ApplicationBlocks.Updater.ActivationProcessors, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="WFE" />
<task type="Microsoft.ApplicationBlocks.Updater.ActivationProcessors.ApplicationDeployProcessor, Microsoft.ApplicationBlocks.Updater.ActivationProcessors, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="AppDeploy" />
</tasks>
</activation>
Any ideas or suggestions?
Thanks,
dlarkin77
|
|
|
|
|
Hi all,
I have differnt types of video files.I need to retrive data from the video file like time,date.And i have to store those values in Xml sheet.I have to include those coding in vb project.
How can i do that.Is there any way to retrive data of video files?
Plz help me..its very urgent
Thanks in advance
cheers
sangeet
|
|
|
|
|
Hi there
i have registered a dll icon library to be assocuited with our .tru extension. everywhere on the sustem the icon is shown, even in outlook when i add a .tru file to a new mail.
but, in outlook, no icon is displayed on incoming mials with a .tru file attached
does anyone know why this is, i have included all icon sizes from 16x16 to 96x96, in three colour variations
is this an outlook problem or is there something else i need to do
you can see an image here,
http://www.vbforums.com/showthread.php?p=2413151#post2413151[^]
I place the dll into the sys 32 folder, then I use the following code to register the icon on the system.
<br />
'CALLING FUNCTION<br />
Call FileAssociation.CreateAssociation("MyFile", "tru", "Myfile File", "Mydll.dll") ' associate tru with icon<br />
<br />
'MODULE<br />
' Usage:<br />
' CreateAssociation Program name, Extension, Description, Iconfile<br />
' EX:<br />
' CreateAssociation "Cryo", "cdf", "Cryo Datafile", "Cryo.dll, 0"<br />
'<br />
'<br />
<br />
Option Explicit<br />
<br />
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long<br />
Public Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long<br />
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long<br />
Public Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As Long<br />
Public Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As Long) As Long<br />
<br />
Public Const REG_SZ As Long = 1<br />
Public Const REG_DWORD As Long = 4<br />
Public Const HKEY_CLASSES_ROOT = &H80000000<br />
Public Const HKEY_CURRENT_USER = &H80000001<br />
Public Const HKEY_LOCAL_MACHINE = &H80000002<br />
Public Const HKEY_USERS = &H80000003<br />
Public Const ERROR_NONE = 0<br />
Public Const ERROR_BADDB = 1<br />
Public Const ERROR_BADKEY = 2<br />
Public Const ERROR_CANTOPEN = 3<br />
Public Const ERROR_CANTREAD = 4<br />
Public Const ERROR_CANTWRITE = 5<br />
Public Const ERROR_OUTOFMEMORY = 6<br />
Public Const ERROR_INVALID_PARAMETER = 7<br />
Public Const ERROR_ACCESS_DENIED = 8<br />
Public Const ERROR_INVALID_PARAMETERS = 87<br />
Public Const ERROR_NO_MORE_ITEMS = 259<br />
Public Const KEY_ALL_ACCESS = &H3F<br />
Public Const REG_OPTION_NON_VOLATILE = 0<br />
<br />
Public Sub CreateAssociation(PROG As String, EXT As String, BESKRIV As String, IconLib As String)<br />
Dim sPath As String<br />
sPath = App.path & "\" & App.EXEName & " %1"<br />
<br />
CreateNewKey "." & EXT, HKEY_CLASSES_ROOT<br />
SetKeyValue "." & EXT, "", PROG, REG_SZ<br />
<br />
CreateNewKey PROG & "\shell\open\command", HKEY_CLASSES_ROOT<br />
CreateNewKey PROG & "\DefaultIcon", HKEY_CLASSES_ROOT<br />
<br />
SetKeyValue PROG, "", BESKRIV, REG_SZ<br />
SetKeyValue PROG & "\shell\open\command", "", sPath, REG_SZ<br />
SetKeyValue PROG & "\DefaultIcon", "", IconLib, REG_SZ<br />
End Sub<br />
Public Sub CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)<br />
'handle to the new key<br />
Dim hKey As Long<br />
'result of the RegCreateKeyEx function<br />
Dim r As Long<br />
r = RegCreateKeyEx(lPredefinedKey, sNewKeyName, 0&, vbNullString, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0&, hKey, r)<br />
Call RegCloseKey(hKey)<br />
End Sub<br />
<br />
Public Sub SetKeyValue(sKeyName As String, sValueName As String, vValueSetting As Variant, lValueType As Long)<br />
'result of the SetValueEx function<br />
Dim r As Long<br />
'handle of opened key<br />
Dim hKey As Long<br />
'open the specified key<br />
r = RegOpenKeyEx(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_ALL_ACCESS, hKey)<br />
r = SetValueEx(hKey, sValueName, lValueType, vValueSetting)<br />
Call RegCloseKey(hKey)<br />
End Sub<br />
<br />
<br />
Public Function SetValueEx(ByVal hKey As Long, sValueName As String, lType As Long, vValue As Variant) As Long<br />
Dim nValue As Long<br />
Dim sValue As String<br />
Select Case lType<br />
Case REG_SZ<br />
sValue = vValue & Chr$(0)<br />
SetValueEx = RegSetValueExString(hKey, sValueName, 0&, lType, sValue, Len(sValue))<br />
Case REG_DWORD<br />
nValue = vValue<br />
SetValueEx = RegSetValueExLong(hKey, sValueName, 0&, lType, nValue, 4)<br />
End Select<br />
End Function<br />
<br />
<br />
<br />
<br />
any help woudl be gretaly appreciated
many thanks
Jamie
|
|
|
|
|
I want to change color of TD or any other property of TD using C# code in ASP.NET. Is it possible ???
Do good and have good.
|
|
|
|
|
You have come to the wrong forum;)
Chatura Dilan
|
|
|
|
|
I want to change color of TD in VB code in ASP.NET
Do good and have good.
|
|
|
|
|
Then ask in the ASP.NET[^] Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes it can be done easily
in the html give id and runat=server to td tag then you can trace it in the code behind
and in the code behind change its color just like that.
HTML Code
C# Code
Color myColor;
myColor = Color.Red;
MYName.BgColor=myColor.ToString();
Thanks
|
|
|
|
|
Basically : How to program controls on a form so that if they are synchronised with each other the updating of one control does not create a domnio effect of updates between the two or more controls.
Eg: Listbox and Spinbutton synchronised through a public variable.
The onchange event with a click on the listbox should update the spinbutton value without this conseguent change in the spinbutton returning an update to the listbox. (and viceversa)
ie. Switch off the controls events for a moment.
I am stuck with finding an elegant solution. I managed to get through in part using boolean flags but I realise this is not the way.
I believed that this could be done without classing the controls however options like Application.EnableEvents=False does not work.
[This is an MsOffice App mainly through VBA forms.]
Any help/examples would be most appreciated
Thanks
|
|
|
|
|
How to Send the Sms From vb.net program
please send to me source code to send sms
Ahmed
|
|
|
|
|
check this
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
hello
again i would like to ask you guys about this problem in datereader that i incounter during play---is says:" There is already an open DataReader associated with this Command which must be closed first."
heres my code:
Dim myconnection As New SqlConnection(My.Settings.sampleConnectionString)
Dim cmdjol As String = "select * from dbo.employee_divisions"
Dim cmd As New SqlCommand(cmdjol, myconnection)
'Parentnode'
Dim mydatareader As SqlDataReader
cmd.Parameters.Add("@description", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Divisions.divname.Text
myconnection.Open()
mydatareader = cmd.ExecuteReader()
While mydatareader.Read()
'If mydatareader.Item(0) = " " Then
TreeView1.Tag = mydatareader.Item(0).ToString
TreeView1.Nodes.Add(mydatareader.GetString(1).ToString)
TreeView1.ShowPlusMinus = True
TreeView1.ShowRootLines = True
Dim cmdj As String = "select description from dbo.employee_departments"
Dim cmds As New SqlCommand(cmdj, myconnection)
Dim xreader As SqlDataReader
cmd.Parameters.Add("@description", SqlDbType.VarChar, 50, ParameterDirection.Input).Value = Departments.depname.Text
xreader = cmds.ExecuteReader
While xreader.Read
TreeView1.Tag = mydatareader.Item(0).ToString
TreeView1.Nodes.Add(xreader.GetString(1).ToString)
End While
xreader.Close()
End While
mydatareader.Close()
myconnection.Close()
can you fix please coz that's for treeview unbound
thnaks in advance....
|
|
|
|
|
i am doing my project using visual studio 2005. i facing the problem the the analsing process cant be stop
and this is the coding i have
'This procedure stops waveIn...
Private Sub stopWaveIn()
Dim result As Integer
'Reset...
result = waveInReset(waveInHandle)
handlePotentialError(result)
'Stop...
result = waveInStop(waveInHandle)
handlePotentialError(result)
Dim i As Integer
For i = 0 To NUMBER_OF_BUFFERS - 1
'Unprepare each buffer...
result = waveInUnprepareHeader(waveInHandle, waveHeader(i), Len(waveHeader(i)))
handlePotentialError(result)
'Free the memory associated with each buffer...
GlobalFree(bufferAddress(i))
Next
End Sub
thanks
|
|
|
|
|
hi,
i am looking for code which activates or initiates scanner on my system or from network using vb.net
please help me out
regards Anas
|
|
|
|
|
hey guys can you help me on how to retrieve value(string/integer) from listview.subitem......im going to put it on Richtextbox.....
thanks for all your support
|
|
|
|
|
Richtextbox.Text&=listview.item(itemIndex).subitem(columnIndex).Text
!alien!
|
|
|
|
|
VB.NET/MS ACCESS/SQL
Consider the following data:
No Name Salary
1 Shawn DSouza I 4000
2 sHAWN D'Souza I 3000
3 Shaw-n DSouza I 2000
The above data is almost similar other that the cases or typing errors or maybe different ways of writing similar things. The data I have contain several such records. What I need to do is group such records together and filter out one record with the highest salary.
It seems like we need to apply some intelligent search ! Can someone help me with this.
With Best Regards,
Mayur
|
|
|
|
|
If I understand your question correctly you want to group the same name records together even if the spelling of the name is different and then find the highest salary record from that group.
First convert the name field to lower case. Then you will have to define a set of characters the can be savely removed from the name field. In that set you could include dash (-), quote ('), and space ( ). For each name remove those characters. This will attempt to convert similiar names to the same name. The way to find the highest salary kind of depends on how the data is stored. If it is in a datatable you can query records returning the highest value in the salary field. Or sort the records by salary in desc order putting the highest value in row 0. Or you can process the records one by one in a for next loop to find the highest salary.
I hope this helps!
|
|
|
|
|
Hi,
I am working on Unicode support for a project built in VB and VC++. We have filenames and filpaths to be Unicode supported.I have taken the hexadecimal values from the Unicode 1.1.5 and created word document files programmatically by taking 5 characrers for each filename in Windows XP.Some files are not created and some files are created with square boxes in the filenames.I am not able to open almost all files by double clicking on them. Doesn't filename support Unicode? I have to know the extra characters (belonging to the basic version of Unicode)to be supported by Unicode supported application. Can Someone help me.
Regards
Ranjan
|
|
|
|
|
guys could you please help me on how to put a string() Array in Richtextbox in run time...
its been my first time in CodeProject and i find it so resourceful spcially for those beginners in VB.Net.....like me
|
|
|
|
|