|
I am creating a VB application. I have 3 buttons and 3 frames. I want to load one frame on click of a particular button.
I am keeping one's visibility true and another one's visibility false. But when I run the application, none of the frame appears.
Why is it so?
Plz help me.
Thanks.
|
|
|
|
|
Purish Dwivedi wrote: Why is it so?
You might just as well ask "How long is a piece of string?".
There is no answer to your question because no one knows what you have done nor how you did it.
Edit your post to show the relevant code. Read the guidelines first here[^], paying particular attention to items 4, 5 and 7.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
First, since "frames" most commonly applies to web applications, you're going to have to specify if this is a web app (there is an ASP.NET forum here for these questions) or a Windows Forms app. Second, if this is a Windows Forms app, how did you implement these "frames"? What controls did you use and how were they arranged? What are the initial properties, like "Visible"? Show the code you're using to hide one "frame" and how another.
|
|
|
|
|
Hi,
I have a program on a CD which I am eventually hoping to sell. Is there anyway that I can put a bit of code on the CD to stop copys of the CD being made.
The program has to be read from the CD as the CD contains videos.
I am using vb.net
Many thanks
Dan
|
|
|
|
|
Sony tried, and they failed. There is no fool-proof way to prevent the duplication of CD's.
You might want to try limiting the number of installations, by asking the user for a registration-key upon installation (or the first start of the application).
I are Troll
|
|
|
|
|
There is no way to prevent this. Copy protection has been the industry's Holy Grail for decades and noone has been able to stop the unauthorized duplication of media.
Even if the videos were is a custom format that no other player could read and the play that COULD read it was supplied by you AND the player "phoned home" to check its license every time it play one of your videos, it could still be cracked.
The bad guys could still use the player's code against itself, having the player decode the video for them and giving them enough information to write their own converter to recreate your videos in a standard format. They could even break the player and trick it into thinking it was getting an OK signal from your licensing server.
The bottom line is that there is no such thing as "copy protection"...
|
|
|
|
|
Hi,
I'm trying to create a crystal report using vb.net and sqlexpress and dataset
Use crystal report wizard, I am able to do the following:
Connect to the database, select the dataset and select the table with the columns(CaseID, Case#, CaseType, CaseDesc, CaseDate)
on the ReportformViewer.vb
bind with the report and i can see the report.rpt
when i load the ReportformViewer.vb, report.rpt show but no data from the table
thanks
|
|
|
|
|
I am working with file names like so: Medic.01.xy.123.654.1001.txt
My main goal is to ascertain the value of the xy segment of the filename. over time the values will range from 11, 13, 15, 16. Then depending on these values, I will need to map to other variables like Hand, Foot, Head or Stomach.
Can I get some assistance is a direction I can go with this project? Thanks
|
|
|
|
|
Take a look at the Split() method of the String class.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry; this is exactly what I need.
Any other pointers on how to assign variables to each part of the name after the split?
|
|
|
|
|
IvanIT wrote: Any other pointers on how to assign variables to each part of the name after the split
It depends on how many parts there are but one technique is to leave the parts in a String Array and then either use Constant values or an Enumeration as an indexer. Something like:
Enum PathParts
Originator = 0
XY = 1
.......
.......
.......
End Enum
' OR
Public Const Originator = 0
Public Const XY = 1
.......
.......
.......
' Assuming your String Array is called SplitPath
' you can then refer to the different parts like this
SplitPath(PathParts.Originator) ' SplitPath(Originator) if you use Constants
SplitPath(PathParts.XY) ' SplitPath(XY) if you use Constants
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
this is what i have going on so far.
<br />
Module nameSplit<br />
<br />
'sectionize the name of claims file to ID program locationID<br />
<br />
' The file system path we need to split<br />
Dim nuFile As String = frmMain.lblClaimsFile.Text<br />
<br />
' Split the string on the period character<br />
Dim segments As String() = nuFile.Split(".")<br />
<br />
Public ProgLoc As String = segments(3)<br />
<br />
<br />
'ID location Code by program code<br />
Dim progCode As String<br />
If ProgLoc = "02" Then<br />
progCode = "6355"<br />
End If<br />
<br />
End Module<br />
I think it is gonna work.
Henry, thanks again!
|
|
|
|
|
This should calculate and display the total amount due. There are 3 radio buttons, A, B, C...Nonprofit should get a 20% discount from final charges. I'm supposed to have three radio buttons (package a, b, and c), and one check box (non-profit). If non-profit is selected, a 20% discount should be deducted from final charges. The number of hours used in a month cannot exceeed 744. Value must be numeric. Also, the packages are internet service providers, each has it own set price, a-10 hours=$9.95, additional hours=$2.00 per, package b-20 hours=$14.95, additional $1.00 per hour and c- unlimited for $19.95.STILL having problems with this.....I can't get the prices to load. And the longer I work on this, the messier it gets.......can someone take a look at it and see if you can help. I'm not asking for the answer but something that is going to make the light go on over my head!!!
Public Class Form1<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
End Sub<br />
<br />
Private Sub radA_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radA.CheckedChanged<br />
<br />
End Sub<br />
<br />
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click<br />
'End the application by closing the window.<br />
Me.Close()<br />
End Sub<br />
<br />
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click<br />
'Clear the text and label boxes.<br />
txtPriceA.Clear()<br />
txtPriceB.Clear()<br />
txtPriceC.Clear()<br />
txtHoursUsedA.Clear()<br />
txtHoursUsedB.Clear()<br />
txtHoursUsedC.Clear()<br />
End Sub<br />
<br />
Private Sub radB_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radB.CheckedChanged<br />
<br />
End Sub<br />
<br />
Private Sub radC_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radC.CheckedChanged<br />
<br />
End Sub<br />
<br />
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click<br />
'txtHoursUsedA > 10<br />
'txtPriceA 9.95<br />
'lblTotal hoursUsed * 2.0<br />
'txtHoursUsedB > 20<br />
'txtPriceB 14.95<br />
'lblTotal hoursUsed * 1.0 <br />
'txtHoursUsedC > 10<br />
'txtPriceC 9.95<br />
'lblTotal hoursUsed * 2.0<br />
<br />
<br />
If radA.Checked True Then<br />
txtPriceA.Text = 9.95<br />
If txtHoursUsedA.Text > 10 Then<br />
End If<br />
<br />
If radB.Checked True Then<br />
txtPriceB.Text = 14.95<br />
If txtHoursUsedA.Text > 20 Then<br />
End If<br />
<br />
If radC.Checked = True Then<br />
<br />
End If<br />
If NonProfit.Checked Then<br />
Total = Total * 0.8<br />
End If<br />
<br />
End Sub<br />
End Class<br />
|
|
|
|
|
It appears you have to Convert your 9text) values. they are messed up in the multiplications
|
|
|
|
|
You should NOT be using the Strings in your TextBox's directly in your calculations. You've done no vlidation of the entered data and have not converted the Strings in those boxes to numeric data types that will fix just about all of your problems.
|
|
|
|
|
Dave Kreskowiak wrote: should NOT be using the Strings in your TextBox's directly in your calculations
I frown on this every semester I teach my class, and yet people continue to do so, and likewise, I knock off points for it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I know they don't know any better, but i still have the urge to smack the bits out of them when they don't grasp the simplest of concepts.
|
|
|
|
|
I was just looking for some help, not criticism...this is the first Visual Basic class I've ever taken. It's not the simplest of concepts to everyone.....some of us spend the whole semester hoping and praying we get through the class without failing, even when we do ask for help. Some get it, some don't. the other programs I've written for the class were fine, this particular one has me sratching my head. I apologize for getting nasty, but again, I just wante help, not criticism for not knowing how to do it.
|
|
|
|
|
Yep, and you got the help. I was not expressing my frustration with you, just newbies in general. I've seen too many of them who can't grasp the concept of x = y + 1 . Where were these people in Algebra class?? And, subsequently, why does a persons I.Q. seem to fall through the floor when you put a keyboard and mouse in front of them??
|
|
|
|
|
One way to deal with this, and I repeat ONE way, is to create a class to hold the charging information and in your form_load event handler add an instance of this class to each of the RadioButtons .
Here is a very simple example of such a class:
Public Class ChargingInfo
Private bHours As Int32 'base hours
Private bRate As Double 'base rate
Private aRate As Double 'additional rate
Public Property BaseHours() As Int32
Get
Return Me.bHours
End Get
Set(ByVal value As Int32)
Me.bHours = value
End Set
End Property
Public Property BaseRate() As Double
Get
Return Me.bRate
End Get
Set(ByVal value As Double)
Me.bRate = value
End Set
End Property
Public Property AdditionalRate() As Double
Get
Return Me.aRate
End Get
Set(ByVal value As Double)
aRate = value
End Set
End Property
End Class
and the Form_Load handler:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ci As ChargingInfo = New ChargingInfo()
ci.BaseHours = 10
ci.BaseRate = 9.95
ci.AdditionalRate = 2.0
Me.radA.Tag = ci
ci = New ChargingInfo()
ci.BaseHours = 20
ci.BaseRate = 14.95
ci.AdditionalRate = 1
Me.radB.Tag = ci
ci = New ChargingInfo()
ci.BaseHours = 0
ci.BaseRate = 19.95
ci.AdditionalRate = 0
Me.radC.Tag = ci
End Sub
Then in your btnCalculate_Click event handler you first retrieve the ChargingInfo from the checked RadioButton and that can then be used throughout the calculation. (As an alternative you could handle the CheckedChanged event handler for the RadioButtons and set a form wide variable to the correct ChargingInfo ). Something like this:
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim cost As Double
Dim ci As ChargingInfo
Dim chargeableHours As Int32 = Math.Min(744, enteredHours)
If Me.radC.Checked Then
ci = CType(Me.radC.Tag, ChargingInfo)
ElseIf Me.radB.Checked Then
ci = CType(Me.radB.Tag, ChargingInfo)
Else
ci = CType(Me.radA.Tag, ChargingInfo)
End If
If ci.BaseHours = 0 Then
cost = chargeableHours * ci.BaseRate
Else
cost = Math.Min(ci.BaseHours, chargeableHours) * ci.BaseRate
chargeableHours = chargeableHours - ci.BaseHours
If chargeableHours > 0 Then
cost = cost + (chargeableHours * ci.AdditionalRate)
End If
End If
If Me.chboxNonProfit.Checked Then
cost = cost * 0.8
End If
Me.txtTotalCost.Text = cost.ToString()
End Sub
**NOTE** enteredHours is the number of hours actually used, you didn't say where that comes from.
Hope that this gives you some ideas.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry - I've seen smaller article than that !
|
|
|
|
|
Mycroft Holmes wrote: Henry - I've seen smaller article than that
Yep. I sometimes get carried away.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi Guys...
do you know of any links that will teach me on how to create a simple gantt chart in vb.net.
or any free controls available for my project.
i have tried google and msdn but have not seen anything that would point me in the right direction.
i need this to create a simple sched program.
thanks
Anoop
|
|
|
|
|
Have you seen Gantt Chart / Event Calendar / Calendar Planner[^] from here on Code Project?
It is a web control, but it might give you some ideas on how to implement your own.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
Thx, will check this out!
much appreciated!
|
|
|
|