Skip to content

How to use CustomBackGroundBlock (CBB) in code

Derek Tremblay edited this page Oct 30, 2019 · 1 revision

The custom background block (ccb) are pretty useful when you want to add a visual over a block of byte.

You can add a description that will be shown in the tooltip. 😊

Sample C# code

public TestCbb()
{
    //Create list of cbb
    HexEdit.CustomBackgroundBlockItems = new List<CustomBackgroundBlock>()
    {
       new CustomBackgroundBlock(23, 16, Brushes.Brown, "position test 1"),
       new CustomBackgroundBlock(56, 26, Brushes.BurlyWood, "position test 2")
    };

    //Create new cbb
    var cbb3 = new CustomBackgroundBlock("0xFA", 16, Brushes.DarkRed, "position test 3");

    //Add the cbb3 to the list
    HexEdit.CustomBackgroundBlockItems.Add(cbb3);

    //Remove cbb3 from the list
    HexEdit.CustomBackgroundBlockItems.Remove(cbb3);
}

Sample VB.NET Code

Public Sub TestCbb()
    'Create list of cbb
    HexEdit.CustomBackgroundBlockItems = New List(Of CustomBackgroundBlock)() From {
        New CustomBackgroundBlock(23, 16, Brushes.Brown, "position test 1"),
        New CustomBackgroundBlock(56, 26, Brushes.BurlyWood, "position test 2")
    }
    
    'Create new cbb
    Dim cbb3 = New CustomBackgroundBlock("0xFA", 16, Brushes.DarkRed, "position test 3")

    'Add the cbb3 to the list
    HexEdit.CustomBackgroundBlockItems.Add(cbb3)

    'Remove the cbb3 to the list
    HexEdit.CustomBackgroundBlockItems.Remove(cbb3)

End Sub
Clone this wiki locally