|
I guess you need to serialise the state of all your controls. I have done this, many times, but I've stored them in the registry. You could just as easily come up with a file format that contains the data needed to set a forms state.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Im having issues with my if statments for this program.
I have 3 ratiobuttons, each one should do a different task.
The first one works alright, but now the 2nd one will not work because of the logic i believe.
It should deduct the value from label3.text, only if
label3 is higher then the amount of the cheque which is Textbox1
If the value of textbox1 is higher then label3 it has to display a messagebox saying insuficient funds. and then deduct a service charge which is declared as 10$
Here is my code. if anyone is able to assist, it would be greatly appreciated.
Dim servicecharge As Integer
Dim transaction As Integer
Dim Balance As Integer
' Declare the value of service charge
servicecharge = 10
transaction = TextBox1.Text
Balance = Label3.Text
' Deposit Funds to the account
If RadioButton1.Checked = True Then
Label3.Text = TextBox1.Text
End If
' Process a cheque through the account, confirming sufficient funds, If returned NSF the account
' will not be deducted the amount of the cheque, but will be charged 10 dollars.
If RadioButton2.Checked = True Then
Balance = Balance - transaction
ElseIf transaction > Balance Then
MessageBox.Show("Insufficient Funds")
Label3.Text = Label3.Text - servicecharge
End If
' Service charge processed on the account.
If RadioButton3.Checked = True Then
Label3.Text = Label3.Text - servicecharge
End If
End Sub
|
|
|
|
|
PLease, please tell me this is not your actual code ? You have variables called RadioButton1 and RadioButton2 ?
aerosmith2k1 wrote: If RadioButton1.Checked = True Then
If the first button is checked, do this
aerosmith2k1 wrote: If RadioButton2.Checked = True Then
If the second one is checked do this ( even if the first was checked )
aerosmith2k1 wrote: ElseIf transaction > Balance Then
If radio button 2 is NOT checked ( that's what the elif does ) AND transaction > balance, then do this
aerosmith2k1 wrote: If RadioButton3.Checked = True Then
If radio button 3 is checked, no matter if the others are, do this.
I suspect your radio buttons work so only one can be checked, but I'd still do an elif to define the three radio button steps. It makes the code more efficient.
And, I think the elif you ARE using, is your problem. Have you tried stepping through the code in the debugger to see what happens, and how it differs from what you expect ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If RadioButton1.Checked = True Then
Label3.Text = TextBox1.Text
End If
If RadioButton2.checked then
If lbl3.value > textbox1.value then
Balance = Balance - transaction
Elseif textbox1.value > label3.value Then
MessageBox.Show("Insufficient Funds")
Label3.Text = Label3.Text - servicecharge
End if
End if
If RadioButton3.Checked = True Then
Label3.Text = Label3.Text - servicecharge
End If
If I am not wrong at getting your logic ,You can try this one
Develop2Program & Program2Develop
|
|
|
|
|
I greatly appreciate your help, very Patient
|
|
|
|
|
Hi boys and girls,
i tried to include a WGA check to my app (plz dont ask why o.o) so i downloaded Windows Defender and copied the "LegitLib.dll" from the program foler to my app folder.
with PE-Explorer i saw that there are the following functions inside this dll
1. LegitCheck
2. LegitCheckCA
3. GetNextStep
4. GetLastErrors
5. SetPartnerID
that sounds good but i have absolutely no idea how to include this into my app! could anybody hel and if its possible explain it me?
many thx!
Sereby
|
|
|
|
|
Probably only Microsoft knows how to use it. There is currently no documentation on the library.
But, I have to ask. Why on earth would your app even care if Windows is authentic or not? You're not Microsoft. I actually see a problem with you using it. WGA isn't exactly the perfect authenticity scanner. It CAN, and does, fail legit machines. What would your customers think about that?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
I am using a simple function which returns a dataset. I get a warning that function does not return value on all code paths.Normally i just say throw in the catch block, which solves the problem.
But as i am implementing enterprise exception block the suggestion is to use a policy with if(rethrow) statement, which i beleive creates the warning as throw is hidden inside if statement. I can say return nothing at the end of catch but i was wondering
What is the best way to get rid of the warning.
Public Function SearchEscalationMails() As DataSet
Try
Dim dbResourcePlanning As Database = DatabaseFactory.CreateDatabase()
Dim strProcName As String = "SearchMailEscalations"
Dim dbSPCommand As DbCommand = dbResourcePlanning.GetStoredProcCommand (strProcName)
dbResourcePlanning.ExecuteDataSet(dbSPCommand)
Return dbResourcePlanning.ExecuteDataSet(dbSPCommand)
Catch ex As Exception
Dim bRethrow As Boolean
bRethrow = ExceptionPolicy.HandleException(ex, "BusinessLayerPolicy")
If (bRethrow) Then
Throw
End If
End Try
End Function
-- modified at 10:49 Sunday 29th April, 2007
|
|
|
|
|
Inside of the exception nothing is returned. It might be better written like this:
dim ds as DataSet = Nothing
Try
...
ds = dbResourcePlanning.ExecuteDataSet(dbSPCommand)
...
Finally
Return ds
End Try
End Function
Hope that helps.
Ben
|
|
|
|
|
Hi Kubben, i think this helps, thanks for your suggestion.
|
|
|
|
|
If you don't rethrow the exception, you have to return something:
If (bRethrow) Then
Throw
Else
Return Nothing
End If
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello,
I am new to .Net and I am looking to add a custom tooltip to a link button with a close button.Please let me know how I can do that .
Thanks,
Uday.
Uday
|
|
|
|
|
Are you taking about a web application? If you are the LinkButton has a property called ToolTip. Just set that property to the correct ToolTip. If you want the browser to close you have to do it in javascript.
Here's some vb code for .net 1.1
Private Sub closeWindow()
Dim myScript As New StringBuilder
With myScript
.Append("<script>")
.Append(Environment.NewLine)
'Close the window
.Append("self.close()")
.Append(Environment.NewLine)
.Append("</script>")
Page.RegisterStartupScript("close window", .ToString())
End With
End Sub
If you are using .net 2.0 the registerstartupscript is a little different.
HOpe that helps.
Ben
|
|
|
|
|
Ben I am Using .Net 2.0 and I want close button to be present on tooltip, I am in a urgent need please help me.
Thanks
Uday.
Uday
|
|
|
|
|
You didn't answer him, is it a web app ?
If not, one obvious way is to create your own class instead of using the built in tooltips.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Do U want the close button to present in the
tool tip window?
Regards,
Arun Kumar.A
|
|
|
|
|
Arun I am Using .Net 2.0 and I want close button to be present on tooltip, I am in a urgent need please help me.
Uday.
Uday
|
|
|
|
|
See if this helps U.
click Here
But, it will show the popup on the click event.(not on the mouse over event.
Try to explore the control, and see if U can achieve what U really want.
Regards,
Arun Kumar.A
|
|
|
|
|
Hai all,
I am currently working a system project that handles Compiling and executing C,C++ programs using click event. Can any one help for me??????????
Senthil.s Software Programmer
|
|
|
|
|
Senthil S wrote: Can any one help for me
Only if you describe what part you're having a problem with.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I guess you need to work out the commmand line for the C++ compiler, and then use Process.Start to call it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Back again!
Is there any simple line of Code that will report in boolean whether or not the Windows the program is running on is Activated or not?
|
|
|
|
|
GNX-Viper wrote: Is there any simple line of Code that will report in boolean
Nope. You have to write this function yourself.
You can gleen some information on how to do this by examining this[^] little script.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks for pointing me in the right direction.
|
|
|
|
|
Hello!
I want to create a vb.net application where I will be able to open and view PDF files. I'm trying to work with AcroPDF.dll provided by Adobe. So far, everything is ok. The only problem is that I want to get rid of ALL menus... I just want to see the viewer... Not the left bookmark menu or the bottom one. How can I do this???
Thank you!
-------------
-= Nasty_p =-
|
|
|
|