
hog
Avatar/Signature-
Posts
1011 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by hog
-
Thanks VolteFace I'll give it a whizz. You say you can't use the ? though? I have my app riddled with this method and they work, this is the first one that hasn't??
-
Nice one I'll give it a whirl:) So when r the twins due?
-
Ah, but the XTrail already has plastic wings etc so maybe......
-
Can anyone see why this would not work? Private Sub CheckForClosedContract() ' set internal error flag to false m_Error = False ' create SQL string to obtain active jobs m_strSQL = "SELECT COUNT(jobid) AS TotalRecords FROM tblJobs WHERE (contractid = ?) AND (active = ?)" ' set properties of the oledbcommand object m_odcJob.CommandType = CommandType.Text m_odcJob.CommandText = m_strSQL ' set the parameter details m_odcJob.Parameters.Add("contractid", m_ContractID) m_odcJob.Parameters.Add("active", True) ' check if the connection is set and open it if not If m_odcJob.Connection Is Nothing Then m_odcJob.Connection = m_objConn m_odcJob.Connection.Open() End If ' try to obtain the count of active jobs, if there are any return, otherwise contract jobs are all closed ' so close contract Try If CType(m_odcJob.ExecuteScalar(), Integer) Then Return Else ' create SQL string to archive the contract with this contractid m_strSQL = "UPDATE tblContracts SET active = 0 WHERE (contractid = ?)" ' set properties of the oledbcommand object m_odcJob.CommandType = CommandType.Text m_odcJob.CommandText = m_strSQL ' set the parameter details m_odcJob.Parameters.Add("contractid", m_ContractID) ' execute the delete query m_odcJob.ExecuteNonQuery() End If Catch objException As Exception ShowError("Location: Class Job" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: CheckForClosedContract()" & ControlChars.CrLf & _ ControlChars.CrLf & "Error Text: " & objException.Message) ' set internal error flag to true m_Error = True Finally ' if the connection is open then close it If m_odcJob.Connection.State = ConnectionState.Open Then m_odcJob.Connection.Close() End If End Try End Sub When I step through the code it does not error and runs the code m_odcJob.ExecuteNonQuery() but when I check the contracts table it's active field remains unchanged?
-
Is there a simply way to have VS calcualte how any lines of code are contained in a project?
-
Ah crap! Just shows you how much I know then:( I thought it was just a case of raise the body and whack on some chunky tyres.........mmmm perhaps a rethink, or buy a Patrol instead:) Thnx
-
Ain't it always the way, just when you give up searching someone jumps up and slaps you in the face.....and only 15 or so miles from home :) http://www.supertrux.com
-
Just another word from me whilst I'm on me soap box. A quote from SAMs Teach Yourself Visual Basic .Net This says it all for me. I only want to check three values and to me xml is just too much like hard work. Less than ten minutes my code is reverted to the registry and is doing exactly as I want:) Maybe at a later date I might find I need to use xml for far greater things, but at the moment it just ain't so :)
-
Nah, I think I will stick with the registry, much simpler and quicker than this xml milarky. I've been at this for over a week now and am still no further forward. Using Saveseting and Getsetting does exactly what I want so why bother with xml which for my purposes is the same as creating an ini file which is well out of date??
-
Thnx Bucky:) I'll do so quick reading:)
-
OK, I'm up the creek without a paddle here so I'll go cap in hand to you guys as I desperately need a quick fix for this. Could someone supply me with a code snippet that will do the following: Open an xml file and read in the content if it exists Create an xml file if it does not exist with the three nodes set to nothing write/save user changes back to the xml file. This is the content of the file: <?xml version="1.0" encoding="utf-8" ?> <config> <location>Wellingborough</location> <notify>0</notify> <notifypreriod>3</notifypreriod> </config> and this is what I'm using to create it if it doesn't exist Dim xmlConfigTextWriter As XmlTextWriter = New XmlTextWriter(strXMLcfg, Nothing) xmlConfigTextWriter.Formatting = System.Xml.Formatting.Indented xmlConfigTextWriter.WriteStartDocument(False) xmlConfigTextWriter.WriteStartElement("config") xmlConfigTextWriter.WriteStartElement("location", Nothing) xmlConfigTextWriter.WriteEndElement() xmlConfigTextWriter.WriteStartElement("notify", Nothing) xmlConfigTextWriter.WriteEndElement() xmlConfigTextWriter.WriteStartElement("notifyperiod", Nothing) xmlConfigTextWriter.WriteEndElement() xmlConfigTextWriter.WriteEndElement() 'Write the XML to file and close the myXmlTextWriter xmlConfigTextWriter.Flush() xmlConfigTextWriter.Close() which results in this? [/code] <?xml version="1.0" standalone="no"?> <config> <location /> <notify /> <notifyperiod /> </config> [/code] please anyone...can u help:(:(:(
-
Well my two pence worth is that everyone is getting over heated over this topic. Let's just all agree that at the moment there isn't a real need for a forum and return to a more cool calm and state of helping each other out whoever we be:) PS no I'm not a hippy!
-
mbf114 I put your bit in but still had to call MoveToFirstChild twice to get to the location node? a_jam, tried your method and it works, but I can't help thinking that there shold be a better way to read in xml. I'm sure the actual tools for the job are fine, just can suss them out at the mo:(
-
can you not check the datasets recordcount property?
-
DOH! oh well perhaps if every now and then we bring this topic up we may get a forum, but hey I still think as forums go this one is topper so nuff said for now:)
-
Just thinking out load here, so please don't flame me if this is out of order, but........... I have a NIssan X-Trail and want to make it higher probably with the use of something called a lift kit and maybe bigger wheels...dunno really. I have been searching the web for ages and have drawn a blank so far. As we have a wide audience on this topper site I was wondering does any of the members know os a solution?
-
Thnx, Mutant, I'm almost there. I had realised this may be the case and had attempted to move the offending block out of the paint procedure. However what I hav now is the shape gets draw OK, but with no outline? And when I select a new colour the controls change with no flicker, but the main form has a bizzare odd section changed only, the rest of the form remains unchanged??
-
see my thread about post not appearing, try the settings on your browser and firewall if you have one
-
I am all for a forum that talks game programming ideas and tips:) I with you on this one PentiumGuy:)
-
Here ya go then:) Public Sub PaintShape() Dim graphPath As New Drawing2D.GraphicsPath Dim gfxGameGraphics As Graphics Dim brBrushSquare As Drawing2D.PathGradientBrush Dim arrLiner1() As Point = {New Point(323, 410), New Point(329, 368), New Point(354, 314), New Point(368, 281)} Dim arrLiner2() As Point = {New Point(27, 319), New Point(69, 300), New Point(87, 320), New Point(101, 292)} Dim arrLiner3() As Point = {New Point(773, 465), New Point(695, 320), New Point(690, 300), New Point(680, 290)} Dim arrLiner4() As Point = {New Point(62, 246), New Point(83, 210), New Point(110, 230), New Point(122, 185)} Dim arrLiner5() As Point = {New Point(867, 123), New Point(865, 123), New Point(870, 115), New Point(874, 111)} graphPath.AddBeziers(arrShape) gfxGameGraphics = Graphics.FromHwnd(Me.Handle) brBrushSquare = New Drawing2D.PathGradientBrush(graphPath) gfxGameGraphics.FillPath(New SolidBrush(clrColour), graphPath) gfxGameGraphics.DrawBeziers(New Pen(Color.Black, 1), arrLiner1) gfxGameGraphics.DrawBeziers(New Pen(Color.Black, 1), arrLiner2) gfxGameGraphics.DrawBeziers(New Pen(Color.Black, 1), arrLiner3) gfxGameGraphics.DrawBeziers(New Pen(Color.Black, 1), arrLiner4) gfxGameGraphics.DrawBeziers(New Pen(Color.Black, 1), arrLiner5) Me.Region = New Region(graphPath) End Sub Private Sub frmGame_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint PaintShape() End Sub Private Sub cmdColour_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdColour.Click Me.ColorDialog1.ShowDialog() clrColour = Me.ColorDialog1.Color clrControlColour = Color.FromArgb(150, Me.ColorDialog1.Color) 'Me.cmdStart.BackColor = clrControlColour 'Me.cmdMinimize.BackColor = clrControlColour 'Me.cmdColour.BackColor = clrControlColour 'Me.cmdClose.BackColor = clrControlColour Me.picGameField.BackColor = clrControlColour Me.picNextBlock.BackColor = clrControlColour Me.Label1.BackColor = clrColour Me.Label2.BackColor = clrColour Me.Label3.BackColor = clrColour End Sub I've left out the array which drawss the shape in the PaintShape procedure
-
Well I have a non regular shape form with 4 buttons, 2 picture boxes and three labels. What I am tryint ot achieve is to allow the user to select the back colour of their choice, which results in the forms backcolor changing and all the controls backcolors to a off shade of the chosen colour. What happens now is I see each control in turn change colour which results in a flicker effect on the form.
-
no, still get the flicker:( No matter what I try the screen flickers. Is there no way to just tell VB, don't display the form changes until they have all been made sonething like: ScreenUpdating(False) button1.backcolor=.... button2.backcolor=.... button3.backcolor=.... button4.backcolor=.... button5.backcolor=.... button6.backcolor=.... other modifications..... ScreenUpdating(True)
-
Ah hold the phone... just added this line: Me.Controls.Add(Me.picNextBlock) and it appears so now to do the rest and see if it resolves the flicker:)
-
OK...still no joy, this is what I have so far: Public Class clsPictureBox Inherits System.Windows.Forms.PictureBox Public Sub New() MyBase.New() 'Add any initialization after the InitializeComponent() call SetStyle(ControlStyles.DoubleBuffer, True) SetStyle(ControlStyles.AllPaintingInWmPaint, True) End Sub End Class Then in my form I have manually entered this code? Friend WithEvents picGameField As clsPictureBox Me.picGameField = New clsPictureBox ' 'picGameField ' Me.picGameField.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(192, Byte), CType(255, Byte)) Me.picGameField.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.picGameField.Location = New System.Drawing.Point(440, 32) Me.picGameField.Name = "picGameField" Me.picGameField.Size = New System.Drawing.Size(163, 304) Me.picGameField.Visible = True no errors occur but the picturebox does not appear either. New ground this, creating my own controls....can u tell :)