Jump to content
Xtreme .Net Talk

Lan Solo

Members
  • Posts

    15
  • Joined

  • Last visited

About Lan Solo

  • Birthday 11/01/1970

Personal Information

  • Occupation
    Sr. Network Administrator
  • Visual Studio .NET Version
    Visual Studio .Net Pro
  • .NET Preferred Language
    VB.NET

Lan Solo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. It is described in the text I am trying to follow. It is supposed to be (I think) a statement in a sub that puts a record pulled from a database in a state that is editable. However the book is very vague as to how to use/code this method.
  2. I am trying to call the editstate method in order to enable a record from a dataset for editing. I am not sure how to declare it, but VB STudio does not seem to like my syntax. Here is what I coded: Private Sub mmuEditEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mmuEditEdit.Click Call EditState(cblnEditing) End Sub I get the squiggly lines under EditState and cblnEditing in the code editor and it states that neither is declared. Thanks
  3. Thanks for the help everyone. Bit by bit I'm gettin' this. "You must unlearn what you have learned." -Yoda
  4. OK, I'm trying that but I am not sure where to put that code, or if I am using the proper syntax. The event handler now looks like: Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudNumberOfGuests.ValueChanged Format(txtGuestSurcharge.Text, "c") If nudNumberOfGuests.Value > 2 Then txtGuestSurcharge.Text = nudNumberOfGuests.Value * csglGuestSurcharge End If If nudNumberOfGuests.Value <= 2 Then txtGuestSurcharge.Text = "0" End If End Sub Any suggestions?
  5. Thanks folks. How do I learn the syntax for the format function?
  6. I am having trouble getting my output to display in monetary format. I have tried the System.ConvertTo method and convert ToString to no avail. So, I saved progress where it was still generating the proper math... just not in dollars. Any tips would be appreciated. Here is what I have: Private lngNumberOfDays As Long Private intnudNumberOfGuests As Integer Private msglBaseRate As Single Private msglSubTotal As Single Private Const csglGuestSurcharge As Single = 10 Private msglBedSurcharge As Single Private msglTotal As Single Private blnchkAdditionalBed As Boolean Private mdatStartDate As Date Private mdatEndDate As Date Private msglRadStandard As Single = "84.50" Private msglRadDeluxe As Single = "104.50" Private msglRadSuite As Single = "154.50" 'This DateTimePicker selects guest arrival date Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpStartDate.ValueChanged mdatStartDate = dtpStartDate.Value.Date End Sub 'This DateTimePicker selects guest departure date Private Sub DateTimePicker2_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtpEndDate.ValueChanged mdatEndDate = dtpEndDate.Value.Date End Sub 'nud determines number of guests Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudNumberOfGuests.ValueChanged If nudNumberOfGuests.Value > 2 Then txtGuestSurcharge.Text = nudNumberOfGuests.Value * csglGuestSurcharge End If If nudNumberOfGuests.Value <= 2 Then txtGuestSurcharge.Text = "0" End If End Sub Thanks
  7. OK I changed the variable and the corresponding event handler to: Private mintNumberOfDays As Integer Private Sub Calculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click NumberOfDays.Text = DateDiff(DateInterval.Day, mdatStartDate, mdatEndDate) and the autos windows is giving me these messages: mdatEndDate #12:00:00 AM# Date mdatStartDate #12:00:00 AM# Date mlngNumberOfDays 0 Long radStandard Nothing System.Windows.Forms.RadioButton
  8. I am having a heck of a time getting the DateDiff result (if it's even being calculated) to pull from the mlngNumberOfDays variable and display it in the text box. Any hints would be appreciated. 'Here are the variables that are applicable to the above mentioned problem Private mlngNumberOfDays As Long Private mdatStartDate As Date Private mdatEndDate As Date 'Here is the event handler Private Sub Calculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click mlngNumberOfDays = DateDiff(DateInterval.Day, mdatStartDate, mdatEndDate) Thanks
  9. I found it. Thank you everyone for you help.
  10. Thanks for the posting tip. It's still erroring out. I pasted in the code from a new solution. Any ideas what I might be doing wrong? I'm a newbie so let me know if I'm in the wrong forum. The entire message in the pop-up tip is: Method 'InitializeComponent' has multiple definitions with identical signatures Thanks in advance
  11. Ok, I pasted in this portion of code: #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() components = New System.ComponentModel.Container() Me.Text = "Form1" End Sub #End Region It says that "InitializeComponect" has multiple definitions. These line of code seem to be the only difference but when I click start it loads a blank interface instead of the one with all my controls. The code for the controls is still there though??!!
  12. I'm not sure how messed up it is. I think I deleted one-too-many lines. Here is the part of the code that I modified. #Region " Windows Form Designer generated code" 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer
  13. ...But I still have the interface design that took me forever to create. Is there a way to create a new solution and use an existing interface design without having to start from scratch on the design? Or is there a way to "fix" the code that I broke? Any help would be appreciated. -Greg
  14. Ok, my verbiage might not be right on the money (cuz I'm a Newbie) but let me try to explain. My school project requires that we declare a data table as a Global Integer Array. The form menu gives the user options to either sum or average the rows and columns and then display the results in a message box. I am having trouble determining the subs or variables that will be used when the click event occurs. Here is some code from the project. If anyone has any suggestions or can see where I am messing up, that would be great. I can't seem to get the desired results to display. Dim gintTable(,) = {{5, 7, 3, 9, 12}, {4, 8, 9, 13, 4}, {0, -1, -7, 13, 8}, {4, 4, 4, 4, 0}} Dim intRowSum As Integer Dim C As Integer Dim R As Integer Dim X As Integer Dim IntSum Dim strX As String Dim ControlChar Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub btnRowSum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRowSum.Click For R = 0 To 3 For X = 1 To 4 For C = 0 To 4 IntSum += gintTable(R, C) Next C strX = IntSum Next X Next R End Sub R is for Row, C is for Column, X is the incremental variable I want to 'attach' to str, so each loop will generate a new total. So - One thing I cannot get it to do, my 'strX' is the 'Result' and the logic is failing. How do I get �strX� to 'hold' it's value each loop, and display in the MsgBox, noncumulative? (I wanted X to increase by 1 each loop and end up with 'str1, str2... or strX1, strX2...) Thanks in advance.
×
×
  • Create New...