Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

David M J

@David M J
About
Posts
24
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how do I Convert Filetime to datetim
    D David M J

    Hi Dave, Fixed it in a more convential way ... : Private Shared Function SystemTimeToDateTime(ByRef st As SYSTEMTIME) As DateTime Dim dt As DateTime Dim dtFormat As String Dim en As New CultureInfo("en-GB") dtFormat = "dd/MM/yyyy HH:mm" With st dt = DateTime.ParseExact( _ Format$(.wDay, "00") & "/" & _ Format$(.wMonth, "00") & "/" & _ Format$(.wYear - 1600) & " " & _ Format$(.wHour, "00") & ":" & _ Format$(.wMinute, "00"), dtFormat, en.DateTimeFormat) ' & ":" & _ ' Format$(.wSecond, "00"), dtFormat, en.DateTimeFormat) End With Return dt End Function Gues it is a bit less efficient, not sure how much though. Your remark about the code and the snot was that just about this problem or also about the rest of the code. If so could you give me some pointers, guess it is never too late to learn. :)) Cheers David Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    Here are the value for st : wDay: 31 wDayOfWeek: 5 wHour: 23 wMilliseconds: 0 wMinute: 0 wMonth: 12 wSecond: 0 wYear: 3604 whith wich values are you testing? Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    Hi, Tried this, assuming that is what you meant ... Dim dt As DateTime = New DateTime(((CType(ft.dwHighDateTime, Long)) << 32) Or CType(ft.dwLowDateTime, Long)) But then I get the exception message: "Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks" Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    Then I still have the problem that I cannot convert the dwLowDateTime to Uint32. As in the original problem. The thing I don't get is that this convertion works fine for C# and vb.net Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    I am getting imediate troubles with .wDay = 14 saying that that cannot be converted to Uint16. Could it be that I need to change one of these option setting. Forgot the name, but as you used to have option strict etc. Be the way thanks for the help, much appreciated. Just one other thing what does << mean can't find that in the help file as it is an illegal entry there. Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    Thanks for the response. I am taking the filetime from the System.Runtime.InteropServices. I am not defining my own structure. However when I use CType(ft.dwLowDateTime, UInt32) I get the error message that I cannot convert from integer to UInt32 for some reason VB assumes the ft.dwLowDateTime is an integer, as in C# this doesn't seem to be the problem. How can I change that? Cheers David Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • how do I Convert Filetime to datetim
    D David M J

    Hi I am trying to convert a systemtime to a normal time. I am using the following code I found in a C# bit, converted it to vb.net C# private static DateTime SystemTimeToDateTime( ref SYSTEMTIME st ) { FILETIME ft = new FILETIME(); NativeMethods.SystemTimeToFileTime( ref st, out ft ); DateTime dt = new DateTime( ( ( (long) ft.dwHighDateTime ) << 32 ) | (uint) ft.dwLowDateTime ); return dt; } VB.NET Private Shared Function SystemTimeToDateTime(ByRef st As SYSTEMTIME) As DateTime Dim ft As FILETIME = New FILETIME NativeMethods.SystemTimeToFileTime(st, ft) Dim dt As DateTime dt = New DateTime(((CType(ft.dwHighDateTime, Long)) << 32) + CType(ft.dwLowDateTime, Integer)) Return dt End Function It all goes fine to the part CType(ft.dwLowDateTime, Integer) as in vb.net the filetime is returned as integer and not as int as it is done in C#. C# to VB converter converted the | into or. I found more articles use + so I changed it as well. But as you can guess it doesn't work and I can't find any non C# stuff anywhere regarding this. So I gues s there is another way of doing or my code is just screwed. Can you help or suggest anything, except reprogramming everything in C# :)) Cheers David Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp help question

  • Datagrid custom columnstyle problem
    D David M J

    Hi, I've got a problem with my custum datagridcolumnstyles. As soon as I sort on a column with a custom column style after I have selected a different row, the code redraws a label(which is the columnstyle in the attached code snippet) the size of the entire grid. Also when changing the readonly status of the datagrid the datagrid seems to "freeze". I am probably missing something, but I am not sure what. Any suggestions? The attached code is converted from C# to vb so there might be some error there. Thanks David Public Class clDTRDataGridLabelColumn Inherits DataGridColumnStyle Private lb As New Label ' The isEditing field tracks whether or not the user is ' editing data with the hosted control. Private isEditing As Boolean Public Sub New() lb.Visible = False lb.Dock = DockStyle.Fill Me.NullText = "" 'tb.Height = 27 End Sub Protected Overrides Sub Abort(ByVal rowNum As Integer) isEditing = False RemoveHandler lb.TextChanged, _ AddressOf lbtextChanged Invalidate() End Sub Protected Overrides Function Commit _ (ByVal dataSource As CurrencyManager, ByVal rowNum As Integer) _ As Boolean lb.Bounds = Rectangle.Empty AddHandler lb.TextChanged, _ AddressOf lbtextChanged If Not isEditing Then Return True End If isEditing = False Invalidate() Return True End Function Protected Overloads Overrides Sub Edit( _ ByVal [source] As CurrencyManager, _ ByVal rowNum As Integer, _ ByVal bounds As Rectangle, _ ByVal [readOnly] As Boolean, _ ByVal instantText As String, _ ByVal cellIsVisible As Boolean) Dim value As String If cellIsVisible Then lb.Text = value lb.Visible = True AddHandler lb.TextChanged, _ AddressOf lbtextChanged Else lb.Text = value lb.Visible = False End If If lb.Visible Then DataGridTableStyle.DataGrid.Invalidate(bounds) End If End Sub Protected Overrides Function GetPreferredSize( _ ByVal g As Graphics, _ ByVal value As Object) As Size Return New Size(100, lb.PreferredHeight) End Function Protected Overrides Function GetMinimumHeight() As Integer Return lb.PreferredHeight End Function Protected Overrides Function GetPrefe

    Visual Basic help csharp css graphics question

  • Help Datagrid freezes after change of readonly
    D David M J

    Hi, I've got a problm with the datagrid. I've changed the datasource of my datagrid to a dataview in order to control this new row that is created when switching between readonly true to false. I am controlling the readonly toggle via a button on the same form. This works fine if I don't touch the datagrid prior to switching the readonly status. However once I have selected a cell in the datagrid and then change the status, it seems like the entire datagrid freezes and I can't do anything. Any suggestions? Thanks David Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    C / C++ / MFC help question

  • How to group within a datagrid
    D David M J

    Hi, I am looking for some way that you can drag and drop a columnheader and create a group based on that. I know there is a lot of third party software doing this, but they more or less all look the same, so I am wondering whether this is somekind of standard feature provided by the grid or that it is realy simple to code. Normally I would find something about this in the articles section as it is a quite common feature, but i couldn't find anything there. Any suggestions? Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    C# css tutorial question

  • New to programming need help for stupid query.
    D David M J

    Hi, Guess you should use the use the textchanged on the textbox setting the enable property on the btnlogin instead of using the enabledchanged on the button, as this would require the button property to change before the code is executed :) Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic database design help

  • How to group within a datagrid
    D David M J

    Hi, I am looking for some way that you can drag and drop a columnheader and create a group based on that. I know there is a lot of third party software doing this, but they more or less all look the same, so I am wondering whether this is somekind of standard feature provided by the grid or that it is realy simple to code. Normally I would find something about this in the articles section as it is a quite common feature, but i couldn't find anything there. Any suggestions? Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic css tutorial question

  • How to convert dynamically convert a dataset to a defined dataset
    D David M J

    Hi, not sure if the subject is really clear but anyway, what I am trying to do is to create a generic data adapter for the different datasets I am using, I don't like all the code .net crestes to add the parameters to the data adapter. In order to do this I read the necessary columns from the tables in the datasets as I or .net defined them on design time. In my procedures I change the columns of my datatables, so in order to creaste the update command parameters I need to get back to the original dataset. As I don't know how to get the original settings out of the current dataset I decided to Dim a new dataset, just for the sstructure, which is the same Type as the current dataset. This works OK if I know at design time what kind of dataset I need to expect, but then durign development you need to go back and update some kind of Select case statement every time you add a new dataset to your project. I have been trying with Ctype and gettype statements but I do not succeed. Guess it is straight forward and I am just missing at least one thing. Any suggestions? Public Sub dsAction(ByVal dsOrig As DataSet) ' Dim Audit1 As clAudit Dim strSQL As String Dim tb As DataTable Dim cl As DataColumn Dim intCount As Integer Dim strSQLUpd As String Dim strSQLUpdWhere As String Dim strSQLIns As String Dim strSQLInsVal As String 'Dim strSQLDel As String Dim Newdataset As New dataset Dim ts As Type 'Audit1 = New clAudit !! THIS line does not work dataset = CType(Newdataset,gettype(dsorig.gettype.fullname)) Try 'Open the connection. 'Me.OleGenCon.Open() For Each tb In Newdataset.Tables Dim OleDaA As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter Dim OleDUpdA As OleDb.OleDbCommand = New OleDb.OleDbCommand Dim OleDInsA As OleDb.OleDbCommand = New OleDb.OleDbCommand strSQLIns = "INSERT INTO " & tb.TableName & "(" strSQLUpd = "UPDATE " & tb.TableName & " SET " 'strSQLDel = "DELETE FROM " & tb.TableName & " WHERE (GEN_ID = ?)" For Each cl In tb.Columns OleDaA.TableMappings(0).ColumnMappings.Add(cl.ColumnName, cl.ColumnName) If Not cl.ColumnName = "TABLE_ID" Then If intCount > 0 Then strSQLIns = strSQLIns & ", "

    Visual Basic csharp design tutorial question announcement

  • how to handle a change on a runtime combobox value to enable the OKbutton
    D David M J

    Hi, I have created a number of form for user input, as they are more or the same I created a routine that creates the form in runtime (adding all the controls at runtime). What I now want to do is to have the save button to get enabled as soon as one of the controls has been changed. As I don't have the controls on the form during design time I am having problems using a eventhandler, basically I don't know how. So what I am asking is how do I create an eventhandler, or something else, in the controls I am adding that trigger an event on the form so that I can enable the Save button. Any pointers would be much appreciated. DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic database design tutorial question

  • How to create realtime forms?
    D David M J

    Hi, I am trying to create an vb app using winforms. I want to always have updated information in the app. So if there are more then one user, and one of users is adding a company, I want the other user to see the company as well after it has been added. Or when one user changes the status of a company I want this update to be send to the other users, if looking at the same data as well. One of the obvious solutions would be to have a timer restrieving the data from the SQL db every couply of seconds, but I guess that will kill a network and there must be more elegant solution, pushing changed data forward. However all the docs I have read until now only talk about a single user and he or she pushing a button to update. Can anybody give me some hints on where to go and some articles to read? Thanks in advance David J Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic database csharp winforms sysadmin tutorial

  • Cumstomizable Mainmenu: how to add the events C#s vs VB.NET
    D David M J

    Hi, I am trying to convert the code in this document: http://www.codeproject.com/cs/miscctrl/custommenu.asp[^] into VB.net instead of C#. I have got most of it done but I am missing the final step, or at least I hope it is the final step. In the article all the menuitems have the following two events added: this.menuItem3.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.OnDrawItemSec); this.menuItem3.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.OnMeasureItemSec); When I look at the source article used for this article, the author writes about going to the eventtab on each menuitem. I am guessing this is typically C# as I cannot find it in VB.net. So can anyone please tell me how to do this? Thanks David J Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp visual-studio com tutorial

  • [VB.NET] Paint MainMenu
    D David M J

    Hi, if you haven't looked at this article it might help you out: http://www.codeproject.com/cs/miscctrl/custommenu.asp[^] Looks like what you want but just in c#. I am trying to convert myselft but I have problems with the eventhandler how to add those, maybe you know, let me know. Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic csharp tutorial

  • How do you create a transparent label on a gradient colored form?
    D David M J

    Hi, Now it works. Made a mistake in the onpaint event... Thanks for the help !! Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic regex help question

  • How do you create a transparent label on a gradient colored form?
    D David M J

    Hi, Unfortunately this doesn't quite do the trick. With the backcolor being transparent, you get the backcolor of the form. However I am overriding the onpaint event of the form to create a gradient background (see code) Any other suggestions? Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) Dim g As Graphics = Me.CreateGraphics Dim myBrush As New LinearGradientBrush(ClientRectangle, Color.WhiteSmoke, _ Color.LimeGreen, LinearGradientMode.Horizontal) g.FillRectangle(myBrush, ClientRectangle) MyBase.OnPaint(e) End Sub thanks DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic regex help question

  • How do you create a transparent label on a gradient colored form?
    D David M J

    Hi, I am trying to create a form with a gradient backcolor with labels on it. I get the gradient back color of the form by overiding the onpaint event of the form. However when I put a label with color.transparant on the form I just get the backcolor of the form, system grey. I found a coulpe of aricles about gradien labels, however then you get the problem that the gradient of the label doesn't match the gradient of the form. Is there a way to get some labels on a form that at least look transparent? Thanks in Advance DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...

    Visual Basic regex help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups