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
J

JR212

@JR212
About
Posts
213
Topics
68
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Strange behavior readline
    J JR212

    The whole code where start is the real game <TargetFramework>net6.0</TargetFramework>

    Sub ClearKBBuffer()
        While Console.KeyAvailable
            Console.ReadKey(True)
        End While
    End Sub
    Sub Main()
        Dim k As ConsoleKey
        Console.TreatControlCAsInput = True
        Randomize()
        Do
            Console.CursorVisible = False
            Dim nLijnen = Start()
            ClearKBBuffer
            Console.CursorVisible = True
            Dim hs As HighScores = HighScores.Load()
            Console.BackgroundColor = ConsoleColor.Red
            Console.ForegroundColor = ConsoleColor.Black
            Dim NewPLace As Integer = -1
            For i As Integer = 0 To 9
                If nLijnen > hs.Scores(i).Lines And NewPLace < 0 Then
                    NewPLace = i
                End If
                Console.SetCursorPosition(10, 10 + i)
                Console.Write(hs.Scores(i).Name.PadRight(30) & hs.Scores(i).Lines.ToString.PadLeft(10) & "   " & hs.Scores(i).PlayDate.ToString("dd/MM/yyyy HH:mm:ss"))
            Next
            Console.Beep()
            If NewPLace >= 0 Then
                Dim NewHS As New Score
                With NewHS
                    .Lines = nLijnen
                    .PlayDate = Now
                    Console.SetCursorPosition(10, 21)
                    Console.Write("New highscore. " & nLijnen & " Your name please? ")
                    .Name = Console.ReadLine
                    .Name = .Name.Trim
                    If .Name = "" Then .Name = "\[No Name\]"
                End With
                For i = 8 To NewPLace Step -1
                    hs.Scores(i + 1) = hs.Scores(i)
                Next
                hs.Scores(NewPLace) = NewHS
                hs.Save()
            End If
            Console.SetCursorPosition(0, Console.WindowHeight - 2)
            Console.WriteLine("New game? (Y/N) ")
            Do
                k = Console.ReadKey.Key
            Loop While k <> ConsoleKey.Y And k <> ConsoleKey.N
        Loop While k = ConsoleKey.Y
    End Sub
    
    Visual Basic tutorial question

  • Strange behavior readline
    J JR212

    That was stupit wasn't it :)

    Visual Basic tutorial question

  • Strange behavior readline
    J JR212

    Hi I've wrote this code

    With NewHS
    .Lines = nLijnen
    .PlayDate = Now
    Console.SetCursorPosition(10, 21)
    Console.Write("New highscore. " & nLijnen & " Your name please? ")
    .Name = Console.ReadLine
    .Name = .Name.Trim
    If .Name = "" Then .Name = "[No Name]"
    End With

    When running the line console.readline It asks for two enters to accept. I see the cursor movingto the begin of the next line by the first enter. The second time the program runs those lines of code it working well with one enter. I'm clearing the keyboardbuffer before starting writing to the console with

    Sub ClearKBBuffer()
    While Console.KeyAvailable
    Console.ReadKey(True)
    Console.ReadKey()
    End While
    End Sub

    Any Idea why or how to solve this. Jan

    Visual Basic tutorial question

  • xml with control createinfo
    J JR212

    OK Thanks both Jan

    Visual Basic csharp question com linux

  • xml with control createinfo
    J JR212

    Yes I did mean Windows Form Application :) So When I see code like that I can create controls like described in de xaml and take over the code and adapt where needed? Any advances for windows forms over wpf? in any direction? Found already this [Difference between WPF and WinForms - GeeksforGeeks](https://www.geeksforgeeks.org/difference-between-wpf-and-winforms/) Jan

    Visual Basic csharp question com linux

  • xml with control createinfo
    J JR212

    Hi Again I found info that uses an xml file to makes controls. [TaskbarItemInfo Class (System.Windows.Shell) | Microsoft Docs](https://docs.microsoft.com/en-us/dotnet/api/system.windows.shell.taskbariteminfo?view=netframework-4.5) However where do i put these files? How do I create them? add > file > xml and change the text. I can do that but how to completly implement those files? I'm working with default windows vb.net applications Jan

    Visual Basic csharp question com linux

  • PHP quota on server
    J JR212

    Hi, Can someone gives me an idea how to get the quotasize on a synology server. The server works with apache 2.4 and php 7.4. I can use exec commands I know disk_free_space and disk_total_space but those commands don't look at quota. Jan I've been lookking with

    $pad = '/volume5/web';
    foreach (array(
    'quota -u jan',
    'df',
    'du'
    ) as $cmd) {
    echo $cmd . '
    ';
    passthru($cmd);
    echo '


    ';
    }
    $used = exec("du -c -a $pad");

    echo 'used: ' . $used . '
    ';
    echo 'quota: ' . exec("quota -u jan") . '
    ';

    $var = exec("cat " . pad . " | grep domz | tail -n 1 | awk '{print $4}'");
    echo 'var: ' . $var . '
    ';

    But so far no luck :(

    Web Development linux php apache sysadmin data-structures

  • retrieve the group header and descriptions(top and bottom)
    J JR212

    your absolutly 100% right. But I can't get it to work

    Visual Basic question announcement workspace

  • retrieve the group header and descriptions(top and bottom)
    J JR212

    Hi Sorry but your first link is for the listviewfooter and not listviewGROUPfouter. I gues I need [ListView_GetGroupInfo macro (commctrl.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-listview\_getgroupinfo) but I cant get that to work. Your question why not use the default control. I do (partely)! I need to work with ownerdraw and the Listview control in dotnet doesn't have support for the groupfooter or the description(top nor bottom). If using dot core 5.0 I can but I need to work with 4.7 or less. I'm been looking for weeks and can't find a working example for the groupfooter. I can if it is normaldraw so I have a code to set the footer but not to get/retrieve it. Jan

    Visual Basic question announcement workspace

  • retrieve the group header and descriptions(top and bottom)
    J JR212

    Still the same as described in this topic. I need to find out what the footertext is in a listviewgroup in a .dotnet4 program throu user32.dll sendmessage. Header is no problem but footer alway return 'nothing' Jan

    Visual Basic question announcement workspace

  • retrieve the group header and descriptions(top and bottom)
    J JR212

    Where are the programmers geniusses from before?

    Visual Basic question announcement workspace

  • retrieve the group header and descriptions(top and bottom)
    J JR212

    Hi, I can find the headertext with

    Dim lvg As New LVGROUP()
    lvg.cbSize = CUInt(Marshal.SizeOf(lvg))
    lvg.mask = LVGF_STATE Or LVGF_GROUPID Or LVGF_HEADER Or LVGF_FOOTER
    Dim nRetHeader2 As Integer = SendMessage(m.HWnd, LVM_GETGROUPINFO, nItem, lvg)
    Dim sHeadText As String = Marshal.PtrToStringUni(lvg.pszHeader)
    Dim sFootTxt As String = Marshal.PtrToStringUni(lvg.pszFooter)

    however the foottext is always empty. same for pszDescriptionTop and pszDescriptionBottom I set the footer with some code I found on the net

    Private Shared Sub SetGrpFooter(ByVal lstvwgrp As ListViewGroup, ByVal footer As String)
    If Environment.OSVersion.Version.Major < 6 Then Return
    If lstvwgrp Is Nothing OrElse lstvwgrp.ListView Is Nothing Then Return
    If lstvwgrp.ListView.InvokeRequired Then
    lstvwgrp.ListView.Invoke(New CallbackSetGroupString(AddressOf SetGrpFooter), lstvwgrp, footer)
    Else
    Dim GrpId As System.Nullable(Of Integer) = GetGroupID(lstvwgrp)
    Dim group As New LVGROUP
    group.CbSize = Marshal.SizeOf(group)
    If (footer = String.Empty) Then
    group.PszFooter = Nothing
    Else
    group.PszFooter = footer
    End If
    'lstvwgrp.HeaderAlignment = HorizontalAlignment.Center
    'group.pszDescriptionBottom = "bottom" & Chr(0)
    'group.pszDescriptionTop = "top"

                group.mask = ListViewGroupMask.Footer + ListViewGroupMask.DescriptionBottom + ListViewGroupMask.DescriptionTop
                Dim ip As IntPtr = Marshal.AllocHGlobal(group.cbSize)
                Marshal.StructureToPtr(group, ip, False)
                If GrpId IsNot Nothing Then
                    group.IGroupId = GrpId.Value
                    SendMessage(lstvwgrp.ListView.Handle, LVM\_SETGROUPINFO, GrpId.Value, ip)
                Else
                    group.iGroupId = GrpId
                    SendMessage(lstvwgrp.ListView.Handle, LVM\_SETGROUPINFO, GrpId.Value, ip)
                End If
            End If
        End Sub
    

    I also can't find the rectangles of where I have to draw the texts What do I do wrong? Jan

    Visual Basic question announcement workspace

  • Listview collapse/expand icon
    J JR212

    Hi I've created my own listview with lots of extra options. like colored headers. Thats where I have a small proplem. What code has the icon at the right of the header for collapse/expand. I've tryed with this enum

    Enum HeaderIconOpenCloseType
    'open
    arrow1 = 8679
    triangle1 = 8711
    V1 = 8744
    small_v1 = 8964
    'closed
    arrow0 = 8681
    triangle0 = 8710
    V0 = 8743
    small_v0 = 8963
    End Enum

    But none of them are exactly the same as the icon the base listview uses. Small_V commes closes to the real one Jan

    Visual Basic

  • vb.net addin won't run in release mode
    J JR212

    I found that to. no help sorry Jan

    Visual Basic csharp visual-studio sysadmin data-structures

  • vb.net addin won't run in release mode
    J JR212

    Hi, I wrote a small addin works perfect in debug-mode, however when I run it in Release-mode I get this error.

    Microsoft.VisualStudio.Tools.Applications.Deployment.AddInAlreadyInstalledException: De aanpassing is niet geïnstalleerd omdat er momenteel een andere versie is geïnstalleerd waarvoor geen upgrade kan worden uitgevoerd vanaf deze locatie. Als u deze versie van de aanpassing wilt installeren, moet u eerst Software gebruiken om het volgende programma te verwijderen: CalPicklist. Installeer vervolgens de nieuwe aanpassing vanaf de volgende locatie: file:///D:/Stack/Visual Studio 2019/Projects/Office/Excel/CalPicklist/bin/Release/CalPicklist.vsto
    bij Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySolutionCodebaseIsUnchanged(Uri uri, String subscriptionId, Boolean previouslyInstalled)
    bij Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    Sorry that's in my language. When I try to install it after the publish No error is given but also not loading. Any ideas what went wrong. I already use clean on the project but no luck. Jan

    Visual Basic csharp visual-studio sysadmin data-structures

  • Default command for an extension in Windows Explorer
    J JR212

    Hi, I'm able to add commands to the Windows Explorer throu the registry. However, how do I set one on the commands as default? I'm noticed that Open is always there but Open is not Always what I want to be the default. Jan

    Design and Architecture question windows-admin

  • Contextmenu in Windows File Explorer
    J JR212

    I found that to but I was hoping that now with Windows 10 there is a way to enlarge that number.

    Design and Architecture question csharp

  • Excel Import
    J JR212

    Maybe with some code we can see whats wrong. anyway: listitem and string are not the same type. listitem.text may help. Jan

    Visual Basic csharp asp-net com

  • Contextmenu in Windows File Explorer
    J JR212

    Hi, I added a submenu to the Windows explorer for directorys. Unfortunately not all the items are visible. Is there a way to show more items than 16 incl all subitems? I was working with ExtendedSubCommandsKey. I really mean menutems and not fileitems. jan Sorry if this is not the right place to ask this. The program is writen in vb.net but the question is stricly Windows.

    Design and Architecture question csharp

  • contextmenu when 2 files are selected
    J JR212

    Unfortunately it's not an app :( but a vb-script. I try to converted it and work like you describe thanks I'll get back later; Maybe a lot later :) Jan

    Visual Basic question linux
  • Login

  • Don't have an account? Register

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