AR3 to AR12 - Toolbox, ToolStrip remove item

Posted by: lesauthjenthu on 26 August 2019, 6:21 pm EST

  • Posted 26 August 2019, 6:21 pm EST

    Me.arToolbox.Groups(0).Text = "tool"

    Me.arToolbox.RemoveToolboxItem(New ToolboxItem(GetType(PageReportModel.Chart)))

    Dim zoomStrip As ToolStrip = Me.arDesigner.CreateToolStrips(GrapeCity.ActiveReports.Design.DesignerToolStrips.Zoom)(0)
    Me.toolStripContainer.TopToolStripPanel.Join(zoomStrip, 0)

    Hi, none of my code above work
    It's display all toolbox and all toolstrip
    Can someone help
  • Replied 27 August 2019, 8:41 pm EST


    The code works fine at our end to remove both Toolbox item and Toolstrip item. Refer the attached modified EUD sample, where the code is used in the constructor.
    Make the necessary modifications in your application and in case the issue persists, share your stripped down sample so that I can assist you further.

  • Replied 3 September 2019, 9:28 pm EST

    hi, may I ask another question
    how can I add a custom event for toolstrip item
    Ex: when click del button do xxx
  • Replied 4 September 2019, 4:34 pm EST


    This can be done by subscribing to the events of the item, after adding the ToolStripMenuItem to a ToolStrip.
        Friend WithEvents toolStripMenuItem1 As New ToolStripMenuItem

    Public Sub New()
    toolStripMenuItem1.Text = "Custom button"
    'Add the Toolstrip at the first index
    toolStripContainer.TopToolStripPanel.Join(zoomStrip, 0)
    End Sub

    Private Sub ClickEvent(sender As Object, ByVal e As EventArgs) Handles toolStripMenuItem1.Click
    MessageBox.Show("Custom button clicked")
    End Sub

    The modified application is attached for your reference.

  • Replied 4 September 2019, 9:02 pm EST

    Hi, I was custom Del, cut button in toolstrip
    Now I want press delete, ctrl + x key work same like this
    I try Overrides Function ProcessCmdKey, Form_KeyDown but not work
    Help me
  • Replied 5 September 2019, 7:41 pm EST


    As per my understanding, you wish to fire click events related to two buttons (Delete and Cut) by pressing their respective key combinations i.e you press delete and ctrl+x keys and you want them to fire the click events of the respective buttons on toolstrip.
    Please inform if this is what is expected. In case this isn't, please elaborate on the requirement along with a use case so that I can understand the same and assist you further.

  • Replied 5 September 2019, 8:12 pm EST

    @Esha: yes, I want to do this :D
    when I click on textbox and delete, it's alway display message box confirm delete or not. I don't want that, I want it go to my custom events
  • Replied 8 September 2019, 3:04 pm EST

    Hello Vuong,

    For this, you don't need to customize your event. You just add the following line of code in your code to avoid the message box while deleting any control.

    arDesigner.PromptUser = False

    Hope it helps.


  • Replied 9 September 2019, 2:34 pm EST

    @mohitg thank you so much, it work
  • Marked as Answer

    Replied 25 September 2019, 4:55 pm EST


    Please use the following line of code:
                arDesigner.PropertyGrid.CommandsVisibleIfAvailable = false;

    Hope it helps.

  • Replied 25 September 2019, 5:00 pm EST

    @mohitg I just find this too, you are too fast, haha
    thanks again
  • Replied 25 September 2019, 5:11 pm EST

    Thanks, Vuong for the compliment
  • Replied 29 September 2019, 9:18 pm EST

    report.StyleSheet("Normal").Value = '"font-style: normal; text-decoration: none; font-weight: normal; font-size: 10pt; color: Black; font-family: MS UI Gothic; ddo-char-set: 128;"

    hi I have another question, what StyleSheet I can set, the code above through error "Style does not exist or is invalid."
  • Replied 29 September 2019, 9:25 pm EST


    Maybe this style never existed. Could you please check in the designer.vb file of the report(in case of code-based report) or Open the Rpx in Notepad and check "Normal" style is present in the report or not.

  • Replied 3 October 2019, 12:24 am EST

    @mohitg, Hi when I print I have extra one blank page at end
    I have check:
    margin + paperwidth < printwidth
    use color for each type of report, but last page is white
    debug: Me.Document.Pages.Count return 1

    what should I do next
  • Replied 3 October 2019, 3:54 pm EST

    Hello Vuong,

    I think you are getting it wrong. Your PrintWidth(property of report) + LeftMargin + RightMargin <= Width of Paper.
    Eg if your paper size equals to A4 then PrintWidth(property of report) + LeftMargin + RightMargin should be less than or equal to 21.0 cm.
    Also, if you are seeing a red line in the report while previewing the report, it means you report size larger than the paper width.

  • Replied 3 October 2019, 5:23 pm EST

    Here is the code working in AR3, It don't have any red line and output 1 page only

           Me.MasterReport = False
    Me.PageSettings.Margins.Bottom = 0.3937008!
    Me.PageSettings.Margins.Left = 0.3937008!
    Me.PageSettings.Margins.Right = 0!
    Me.PageSettings.Margins.Top = 0.3937008!
    Me.PageSettings.Orientation = GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape
    Me.PageSettings.PaperHeight = 11.69!
    Me.PageSettings.PaperWidth = 8.27!
    Me.PrintWidth = 11.02756!
    Me.ScriptLanguage = "VB.NET"

    And then AR12, it have another blank page for no reason :(
  • Replied 3 October 2019, 5:41 pm EST

    Hello Vuong,

    I have checked at my end and it only prints one page. Please refer to the attached application.
    Also, could you please check with the latest version of AR12. You can download the same from the following link:

    If the problem still occurs, Could you please either modify the attached report or provide your own stripped-down report so that I can try reproducing the same behavior at my end and assist you further accordingly?

  • Replied 7 October 2019, 6:15 pm EST

    when i'm print direct => have blank page
    when i'm preview => no blank page
    when i'm print in preview page => no blank page
    any suggest from you ?
  • Replied 8 October 2019, 5:33 pm EST


    Could you share how you are printing the report(Directly from the designer/viewer or using code)
    If you are using code to print the report, then please share the code snippet of the printing code.
    Are you replicate the same problem with my sample(which is given in the previous reply of me)?

    This will be very helpful fo us to narrow down the issue.

    Also, please share the exact build of AR that you are using.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels