Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:16:46+00:00 2026-05-27T20:16:46+00:00

So, my end game here is to have a way to list items (like

  • 0

So, my end game here is to have a way to list items (like a TListView in vsReport) with the add/remove buttons inside the client area.

Ex:

|----------------|
|Old Item 1    X |
|Old Item 2    X |
|Add new item... |
|                |
|----------------|

If you know of a component that does this without all this extra work, please let me know!

So I picked out an red close “X” and am using a TJvTransparentButton (Jedi Components – JVCL) to display it. It handles the press/not pressed states and only shows the image. I original used a TButton but I didn’t need all the fluff that goes around the glyph.

Now, I keep the image button in the record associated with each node.

Code is as follows:

procedure TfrmMain.AddNewAccount(const Username, Password: String);
var
  Data : PTreeData;
  XNode : PVirtualNode;
Begin
  XNode := vstAccounts.AddChild(nil);
  If vstAccounts.AbsoluteIndex(XNode) > -1 Then
    begin
    Data := vstAccounts.GetNodeData(Xnode);
    Data^.Column0 := Username;
    Data^.Column1 := '';
    Data^.DeleteButton := TJvTransparentButton.Create(nil);
    With Data^.DeleteButton Do
      begin
      Parent := vstAccounts;
      Left := 0;
      Top := 0;
      Width := 16;
      Height := 16;
      Anchors := [];
      AutoGray := False;
      BorderWidth := 0;
      FrameStyle := fsNone;
      Images.ActiveImage := iListView;
      Images.ActiveIndex := 0;
    end;
  end;
end;

In the OnAfterCellPaint event I manage the positioning of the image button like so:

procedure TfrmMain.vstAccountsAfterCellPaint(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
  CellRect: TRect);
var
  Data : PTreeData;
begin
  If Column = 1 Then
    begin
    Data := vstAccounts.GetNodeData(Node);
    If Assigned(Data) Then
      begin
      With Data^.DeleteButton Do
        begin
        BoundsRect := CellRect;
      end;
    end;
  end;
end;

Now the problem is that this doesn’t show the item at all. I know that the Image from the TImageList is fine because I can create the button at design time and it looks fine at runtime.

I also know that this code should work because if I make the TJvTransparentButton a regular TButton (without changing the code logic) it works just fine and shows up fine!

The only thing I can think of is that a TButton inherits from a TWinControl while the TJvTransparentButton inherits from a TControl.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:16:46+00:00Added an answer on May 27, 2026 at 8:16 pm

    I assume the TJvTransparentButton is a TGraphicControl and as such is displayed as part of the Parent’s background (that’s why a Tlabel will always be behind a TEdit or TButton in the same Parent).
    The TButton is a TWinControl and as such is painted on top of the Parent and above or below the other WinControls in the same Parent.

    So, either, you paint yourself again the TJvTransparentButton after the regular drawing of the cell happened (updating BoundsRect is not enough) or you use a WinControl.
    For instance, using a TPanel with the TJvTransparentButton in it should work.

    Disclaimer: I’m not familiar with VirtualStringTree nor TJvTransparentButton …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an app where you play a game, and at the end
I'm trying to add the score at the end of the game to Game
I've created a game which gives a score at the end of the game,
Error: End tag for 'optgroup' which is not finished. You have probably failed to
Back-end: I have a model (User) that has_many of another model (ContactPreference). Front-end: An
I am in the process of localizing a game. I have roughly 1% of
I'm trying to do collision check on my game objects. I have a multimap,
[SOLVED]: Applying proper list iteration procedure fixed problem. (Shown below) I currently have a
What I am trying to do is, have a list of characters,each of which
Okay, so I have this partially working game, I know the solutions should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.