This is possible to hide the Close button in JFrame

As title
If can, please let me know how

You can tell the frame not to decorate with JFrame.setFrameUndecorated() {or something like that,
look it up in the API}, or you can specify your own decorations. I'm guessing that you really don't
want to do either of those, though.

Similar Messages

  • Disabling the Close Button of JFrame or Frame

    Dear Friends,
    can anybody please help out to solve the problem i am having in disabling the close button of Jframe . Or try for hiding the close button from the screen
    thanks kalyan

    to disable the close button
    myFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)

  • Is it possible to hide the "Dashboard" button in InfoView?

    Hi,
    my customer is complaining about an error message when choosing the "Dashboard" button in InfoView. The error is described here:
    Unable to access dashboard  in infoview
    and seems to be related to accounts other than administrators. However, I don't want to solve the problem, I just want to disable or remove the "Dashboard" button in InfoView. Is that possible anyhow?
    Regards
    Joern

    Best you could do would be to disable or "grey out" the Dashboards button, can do this by removing access to Performance Management in the CMC under Applications.

  • Is it possible to hide the save function and only use the save as function in teststand

    Hi,
    When i'm done building a sequence i want to prevent other engineers to save the sequence with the same filename (or version number).
    Is it somehow possible to "hide" the save button and only use the save as function?
    Or is there another possiblity to solve my problem.
    The idea is to have a sequence called Sequence_V1.0.seq which i have build. When installing this in a factory enviroment I would like whenever there is a change needed in the sequence that the version number increases (manual action) (becomes Sequence_V1.1.seq). So from the moment you want to save i would like to only have the function save as. In this way you are obligated to fill in a new sequence name (original sequence will be read-only)
    What would even be great if there could be a log of what the changes were
    Thx!!! 

    1) You could mark the file as read-only, by default you would then not be able to save over it. The user could make it not read-only though if they know what they are doing.
    2) Another possibility is to lock the sequence file for editing (this is a teststand feature). Go to the Sequence File Property dialog, on the advanced tab, where it says Password Protection, set it to Not Editable and give it a good password. This doesn't however keep someone from saving another file to the same name as the locked one, but they at least won't be able to saved the locked file again without your password, nor will they be able to edit it.
    Hope this helps,
    -Doug

  • Hide the Email Button

    Hi,
    Is it possible to hide the email button when it is clicked and have it replaced with a comment of some type, ie 'Thank you for your submission!'
    Frank

    This is what I don so far.
    I created the Submit by Email button and made the presence invisible. then I created another button (button1) and the control type is regular (not execute or submit)I then added the script
    EmailSubmitButton1.execEvent("click");
    Button1.presence="invisible";
    app.alert("Thank You for Your Response");
    to the Click option in the javascript window. Should one button be over the other button and how do I click the button to ignitate the emailing process. Nothing happens. I appreciate you help;
    Frank

  • Is it possible to change the size of the 'Close' button in Full Screen viewing mode?

    I am currently using Firefox for a kiosk type scenario. We require that the browser run full screen. The issue is that the 'Close' button is not large enough for users to consistently see, so they're having issues figuring out how to close an active browser window.
    Can anyone tell me if it's possible to change this icon? I've tried using themes, but they tend to theme everything but the close button.
    Custom configuration details are below.
    Firefox version: firefox-3.0.4-1.el5.centos
    Customisations:
    Access to local drives disabled:
    Modified the contents of /usr/lib/firefox-3.0.4/chrome/browser.jar, so that browser.js has the added stanza:
    <pre><nowiki>if (location.match(/^file:/) ||
    location.match(/^\//) ||
    location.match(/^resource:/) ||
    (!location.match(/^about:blank/) &&
    location.match(/^about:/))) {
    loadURI("about:blank");
    }</nowiki></pre>
    Various menus & bookmarks disabled in chrome/userChrome.css
    <pre><nowiki>/* Kill "normal" bookmark icons in the bookmarks menu */
    menuitem.bookmark-item > .menu-iconic-left {
    display: none;
    /* kill icons for bookmark folders in Bookmarks menu */
    menu.bookmark-item > .menu-iconic-left {
    display: none;
    /* kill icons for bookmark groups in Bookmarks menu */
    menuitem.bookmark-group > .menu-iconic-left {
    display: none;
    /* Remove the Edit and Help menus
    Id's for all toplevel menus:
    file-menu, edit-menu, view-menu, go-menu, bookmarks-menu, tools-menu, helpMenu */
    helpMenu { display: none !important; }
    tools-menu { display: none !important; }
    file-menu { display: none !important; }
    edit-menu { display: none !important; }
    view-menu { display: none !important; }
    go-menu { display: none !important; }
    bookmarks-menu { display: none !important; }
    #autohide-context { display: none !important;}
    #bookmarksToolbarFolderMenu { display: none !important;}
    #organizeBookmarksSeparator { display: none !important;}
    .tabbrowser-tabs .tab-icon {
    display: none;
    #urlbar {
    font-family: Arial !important;
    color: Black !important;
    font-size: 26 !important; }</nowiki></pre>

    Try code like this:
    <pre><nowiki>#window-controls .toolbarbutton-icon {
    width: 25px !important;
    height: 25px !important;
    </nowiki></pre>
    The three buttons have these IDs:
    <pre><nowiki>#minimize-button
    #restore-button
    #close-button</nowiki></pre>

  • All of a sudden my Firefox brower will not open correctly. It keeps telling me that it is trying to restore the previous session, but it doesnt' matter if I press the Restore button or the Close button to try again, it will not work. How can I fix this?

    After I hit the Close button and try to reopen it tells me that Firefox is currently already running and to either close it or restart my computer. Which I did, and it didn't do anything. Also, when I press the restore button, it will not restore, it just sits there. Please help, I hate Internet Explorer and I don't want to use it longer than I need to.

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js [2] and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    * [1] http://kb.mozillazine.org/Session_Restore
    * [2] http://kb.mozillazine.org/sessionstore.js

  • I am using a Microsoft Natural keyboard and when i use the close button on Ver. 5.0 or newer it closes the whole screen not just the active tab is there a fix for this

    I am using a Microsoft Natural 4000 Keyboard
    IF I update to Mozila 5.0 when i use the close button it shuts down the whole browser nut just the active tab
    Is there a workaround for this because I like the close button feature

    Could you try disabling graphics hardware acceleration? (I'm having trouble determining from your "More system information" whether it's enabled or disabled.) Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You usually need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    orange Firefox button ''or'' classic Tools menu > Options > Advanced
    On the "General" mini-tab, uncheck the box for "Use hardware acceleration when available"
    If you restart Firefox, is the issue resolved?

  • I have an iPhone 3GS and it recently started to make a Cicada type of sound when pushing the close button on the top right hand of the phone. Can anybody give me feedback on what this is or how I might be able to fix it?

    I have an iPhone 3GS and it recently started to make a Cicada type of sound when pushing the close button on the top right hand of the phone. Can anybody give me feedback on what this is or how I might be able to fix it?

    It will be replaced with the exact same model. It is not expensive compared to the full retail price of a new phone (without carrier subsidies).
    If you're eligible for an upgrade from your carrier, now might be a good time to consider upgrading to an iPhone 5, though.

  • Adding Icon and increasing width of tabpages to show the close button in a tabcontrol

    I have this code right now,
    Public Class FSMTabControl
    Inherits TabControl
    #Region "Declarations"
    Private _TextColour As Color = Color.FromArgb(255, 255, 255)
    Private _BackTabColour As Color = Color.FromArgb(54, 54, 54)
    Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
    Private _ActiveColour As Color = Color.FromArgb(47, 47, 47)
    Private _BorderColour As Color = Color.FromArgb(30, 30, 30)
    Private _UpLineColour As Color = Color.FromArgb(0, 160, 199)
    Private _HorizLineColour As Color = Color.FromArgb(23, 119, 151)
    Private CenterSF As New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center}
    #End Region
    #Region "Properties"
    <Category("Colours")> _
    Public Property BorderColour As Color
    Get
    Return _BorderColour
    End Get
    Set(value As Color)
    _BorderColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property UpLineColour As Color
    Get
    Return _UpLineColour
    End Get
    Set(value As Color)
    _UpLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property HorizontalLineColour As Color
    Get
    Return _HorizLineColour
    End Get
    Set(value As Color)
    _HorizLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property TextColour As Color
    Get
    Return _TextColour
    End Get
    Set(value As Color)
    _TextColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BackTabColour As Color
    Get
    Return _BackTabColour
    End Get
    Set(value As Color)
    _BackTabColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BaseColour As Color
    Get
    Return _BaseColour
    End Get
    Set(value As Color)
    _BaseColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property ActiveColour As Color
    Get
    Return _ActiveColour
    End Get
    Set(value As Color)
    _ActiveColour = value
    End Set
    End Property
    Protected Overrides Sub CreateHandle()
    MyBase.CreateHandle()
    Alignment = TabAlignment.Bottom
    End Sub
    #End Region
    #Region "Draw Control"
    Sub New()
    SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
    ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
    DoubleBuffered = True
    Font = New Font("Segoe UI", 10)
    SizeMode = TabSizeMode.FillToRight
    ItemSize = New Size(240, 32)
    End Sub
    Protected Overrides Sub OnPaint(e As PaintEventArgs)
    Dim g = e.Graphics
    With G
    .SmoothingMode = SmoothingMode.HighQuality
    .PixelOffsetMode = PixelOffsetMode.HighQuality
    .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
    .Clear(_BaseColour)
    Try : SelectedTab.BackColor = _BackTabColour : Catch : End Try
    Try : SelectedTab.BorderStyle = BorderStyle.FixedSingle : Catch : End Try
    .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
    For i = 0 To TabCount - 1
    Dim Base As New Rectangle(New Point(GetTabRect(i).Location.X, GetTabRect(i).Location.Y), New Size(GetTabRect(i).Width, GetTabRect(i).Height))
    Dim BaseSize As New Rectangle(Base.Location, New Size(Base.Width, Base.Height))
    If i = SelectedIndex Then
    .FillRectangle(New SolidBrush(_BaseColour), BaseSize)
    .FillRectangle(New SolidBrush(_ActiveColour), New Rectangle(Base.X + 1, Base.Y - 3, Base.Width, Base.Height + 5))
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), New Rectangle(Base.X + 7, Base.Y, Base.Width - 3, Base.Height), CenterSF)
    .DrawLine(New Pen(_HorizLineColour, 2), New Point(Base.X + 3, CInt(Base.Height / 2 + 2)), New Point(Base.X + 9, CInt(Base.Height / 2 + 2)))
    .DrawLine(New Pen(_UpLineColour, 2), New Point(Base.X + 3, Base.Y - 3), New Point(Base.X + 3, Base.Height + 5))
    Else
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), BaseSize, CenterSF)
    End If
    Next
    .InterpolationMode = InterpolationMode.HighQualityBicubic
    End With
    End Sub
    Private Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
    Protected CloseButtonCollection As New Dictionary(Of Button, TabPage)
    Private _ShowCloseButtonOnTabs As Boolean = True
    <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> _
    Public Property ShowCloseButtonOnTabs() As Boolean
    Get
    Return _ShowCloseButtonOnTabs
    End Get
    Set(ByVal value As Boolean)
    _ShowCloseButtonOnTabs = value
    For Each btn In CloseButtonCollection.Keys
    btn.Visible = _ShowCloseButtonOnTabs
    Next
    RePositionCloseButtons()
    End Set
    End Property
    Protected Overrides Sub OnCreateControl()
    MyBase.OnCreateControl()
    RePositionCloseButtons()
    End Sub
    Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs)
    MyBase.OnControlAdded(e)
    Dim tp As TabPage = DirectCast(e.Control, TabPage)
    Dim rect As Rectangle = Me.GetTabRect(Me.TabPages.IndexOf(tp))
    Dim btn As Button = AddCloseButton(tp)
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    SetParent(btn.Handle, Me.Handle)
    AddHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Add(btn, tp)
    End Sub
    Protected Overrides Sub OnControlRemoved(ByVal e As System.Windows.Forms.ControlEventArgs)
    Dim btn As Button = CloseButtonOfTabPage(DirectCast(e.Control, TabPage))
    RemoveHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Remove(btn)
    SetParent(btn.Handle, Nothing)
    btn.Dispose()
    MyBase.OnControlRemoved(e)
    End Sub
    Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs)
    MyBase.OnLayout(levent)
    RePositionCloseButtons()
    End Sub
    Public Event CloseButtonClick As CancelEventHandler
    Protected Overridable Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As EventArgs)
    If Not DesignMode Then
    Dim btn As Button = DirectCast(sender, Button)
    Dim tp As TabPage = CloseButtonCollection(btn)
    Dim ee As New CancelEventArgs
    RaiseEvent CloseButtonClick(sender, ee)
    If Not ee.Cancel Then
    Me.TabPages.Remove(tp)
    RePositionCloseButtons()
    End If
    End If
    End Sub
    Protected Overridable Function AddCloseButton(ByVal tp As TabPage) As Button
    Dim closeButton As New Button
    With closeButton
    '' TODO: Give a good visual appearance to the Close button, maybe by assigning images etc.
    '' Here I have not used images to keep things simple.
    .Text = "X"
    .FlatStyle = FlatStyle.Flat
    .BackColor = _BaseColour
    .ForeColor = Color.White
    .Font = New Font("Microsoft Sans Serif", 6, FontStyle.Bold)
    End With
    Return closeButton
    End Function
    Public Sub RePositionCloseButtons()
    For Each item In CloseButtonCollection
    RePositionCloseButtons(item.Value)
    Next
    End Sub
    Public Sub RePositionCloseButtons(ByVal tp As TabPage)
    Dim btn As Button = CloseButtonOfTabPage(tp)
    If btn IsNot Nothing Then
    Dim tpIndex As Integer = Me.TabPages.IndexOf(tp)
    If tpIndex >= 0 Then
    Dim rect As Rectangle = Me.GetTabRect(tpIndex)
    If Me.SelectedTab Is tp Then
    btn.BackColor = Color.Red
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    Else
    btn.BackColor = _BaseColour
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    End If
    btn.Visible = ShowCloseButtonOnTabs
    btn.BringToFront()
    End If
    End If
    End Sub
    Protected Function CloseButtonOfTabPage(ByVal tp As TabPage) As Button
    Return (From item In CloseButtonCollection Where item.Value Is tp Select item.Key).FirstOrDefault
    End Function
    #End Region
    End Class
    This code shows a perfect tabcontrol as in the picture below,
    I managed to get this code working by combining three other VB themes I found. Right now, I just want to increase the width of the tab so the close button doesn't hides the text. And I want to add a icon to the left of the tab and be able to change it on
    runtime.
    The icons name will be on, off, 1, 2, plus .ico 
    Is it possible ? and is it possible to make the tabs curved at the corner like in chrome.

    Hi,
     I have went through your TabControl class and changed it around a little bit to get something similar to what i think you want.  I made it so that the Tabs are resized with the TabControl itself so that they always fill the width of the TabControl. 
    I also, made the Text of the tabs have its own rectangle which will automatically adjust it`s width according to weather or not the close buttons are shown so the text will never be under the buttons.
     As for the Icons, you could create another small class that inherits from the TabPage base class and add a public property to it for the Icon image.  You would have to use that class to add TabPages and set the Icon property.  Then in the
    TabControl class`s OnPaint overrides sub you would check if the Icon property of the TabPage is set and draw the image if it is.
     I didn`t go that far but, i used the TabPage`s Tag property for the Icon image.  Actually it is just an Image, not an Icon.  So, in the TabControl`s OnPaint overrides sub i check if the TabPage`s Tag property is set to an Image and if it
    is i adjust the Text rectangle to avoid the Image and draw the image.
     I moved the StringFormat to the OnPaint sub and set it to keep the text left aligned so it stayed next to the Image.  You can change it back to the Center if you want.  I also set the StringFormat trimming to EllipsisCharacter so it will
    cut the text off if it is to long to fit between the Image and the Close button.
     You can test it in a new form project first and to check out how it works and what i changed.
    Imports System.ComponentModel
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Text
    Public Class FSMTabControl
    Inherits TabControl
    #Region "Declarations"
    Private _TextColour As Color = Color.FromArgb(255, 255, 255)
    Private _BackTabColour As Color = Color.FromArgb(54, 54, 54)
    Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
    Private _ActiveColour As Color = Color.FromArgb(47, 47, 47)
    Private _BorderColour As Color = Color.FromArgb(30, 30, 30)
    Private _UpLineColour As Color = Color.FromArgb(0, 160, 199)
    Private _HorizLineColour As Color = Color.FromArgb(23, 119, 151)
    #End Region
    #Region "Properties"
    <Category("Colours")> _
    Public Property BorderColour() As Color
    Get
    Return _BorderColour
    End Get
    Set(ByVal value As Color)
    _BorderColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property UpLineColour() As Color
    Get
    Return _UpLineColour
    End Get
    Set(ByVal value As Color)
    _UpLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property HorizontalLineColour() As Color
    Get
    Return _HorizLineColour
    End Get
    Set(ByVal value As Color)
    _HorizLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property TextColour() As Color
    Get
    Return _TextColour
    End Get
    Set(ByVal value As Color)
    _TextColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BackTabColour() As Color
    Get
    Return _BackTabColour
    End Get
    Set(ByVal value As Color)
    _BackTabColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BaseColour() As Color
    Get
    Return _BaseColour
    End Get
    Set(ByVal value As Color)
    _BaseColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property ActiveColour() As Color
    Get
    Return _ActiveColour
    End Get
    Set(ByVal value As Color)
    _ActiveColour = value
    End Set
    End Property
    Protected Overrides Sub CreateHandle()
    MyBase.CreateHandle()
    Alignment = TabAlignment.Bottom
    End Sub
    #End Region
    #Region "Draw Control"
    Sub New()
    SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
    DoubleBuffered = True
    Font = New Font("Segoe UI", 10)
    SizeMode = TabSizeMode.Fixed
    End Sub
    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    With e.Graphics
    .SmoothingMode = SmoothingMode.HighQuality
    .PixelOffsetMode = PixelOffsetMode.HighQuality
    .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
    .Clear(_BaseColour)
    Try : SelectedTab.BackColor = _BackTabColour : Catch : End Try
    Try : SelectedTab.BorderStyle = BorderStyle.FixedSingle : Catch : End Try
    .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
    If Me.Created AndAlso Me.TabCount > 0 Then
    Dim tw As Integer = CInt(Me.ClientSize.Width / Me.TabCount)
    Dim offset As Integer = Me.TabCount
    If Me.ItemSize.Width <> tw - offset Then Me.ItemSize = New Size(tw - offset, 32)
    End If
    Using CenterSF As New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center, .Trimming = StringTrimming.EllipsisCharacter, .FormatFlags = StringFormatFlags.NoWrap}
    For i As Integer = 0 To TabCount - 1
    Dim Base As Rectangle = Me.GetTabRect(i)
    Dim txtrect As New Rectangle(Base.Left, Base.Top, Base.Width, Base.Height)
    Dim img As Image = Nothing
    If Me.TabPages(i).Tag IsNot Nothing Then
    txtrect.X += Base.Height
    txtrect.Width -= Base.Height
    img = DirectCast(Me.TabPages(i).Tag, Image)
    End If
    If ShowCloseButtonOnTabs Then
    txtrect.Width -= Base.Height
    End If
    If i = SelectedIndex Then
    .FillRectangle(New SolidBrush(_BaseColour), Base)
    .FillRectangle(New SolidBrush(_ActiveColour), New Rectangle(Base.X + 1, Base.Y - 3, Base.Width, Base.Height + 4))
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), txtrect, CenterSF)
    .DrawLine(New Pen(_HorizLineColour, 2), New Point(Base.X + 3, CInt(Base.Height / 2 + 2)), New Point(Base.X + 9, CInt(Base.Height / 2 + 2)))
    .DrawLine(New Pen(_UpLineColour, 2), New Point(Base.X + 3, Base.Y - 3), New Point(Base.X + 3, Base.Height + 5))
    Else
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), txtrect, CenterSF)
    End If
    If img IsNot Nothing Then
    .DrawImage(img, Base.Left + 2, Base.Top + 2, Base.Height - 4, Base.Height - 4)
    End If
    Next
    End Using
    .InterpolationMode = InterpolationMode.HighQualityBicubic
    End With
    End Sub
    Private Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
    Protected CloseButtonCollection As New Dictionary(Of Button, TabPage)
    Private _ShowCloseButtonOnTabs As Boolean = True
    <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> _
    Public Property ShowCloseButtonOnTabs() As Boolean
    Get
    Return _ShowCloseButtonOnTabs
    End Get
    Set(ByVal value As Boolean)
    _ShowCloseButtonOnTabs = value
    For Each btn As Button In CloseButtonCollection.Keys
    btn.Visible = _ShowCloseButtonOnTabs
    Next
    RePositionCloseButtons()
    Me.Refresh()
    End Set
    End Property
    Protected Overrides Sub OnCreateControl()
    MyBase.OnCreateControl()
    RePositionCloseButtons()
    End Sub
    Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs)
    MyBase.OnControlAdded(e)
    Dim tp As TabPage = DirectCast(e.Control, TabPage)
    Dim rect As Rectangle = Me.GetTabRect(Me.TabPages.IndexOf(tp))
    Dim btn As Button = AddCloseButton(tp)
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    SetParent(btn.Handle, Me.Handle)
    AddHandler btn.Click, AddressOf OnCloseButtonClick
    'ResizeTabs()
    CloseButtonCollection.Add(btn, tp)
    End Sub
    Protected Overrides Sub OnControlRemoved(ByVal e As System.Windows.Forms.ControlEventArgs)
    Dim btn As Button = CloseButtonOfTabPage(DirectCast(e.Control, TabPage))
    RemoveHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Remove(btn)
    SetParent(btn.Handle, Nothing)
    btn.Dispose()
    MyBase.OnControlRemoved(e)
    'ResizeTabs()
    End Sub
    Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs)
    MyBase.OnLayout(levent)
    RePositionCloseButtons()
    End Sub
    Public Event CloseButtonClick As CancelEventHandler
    Protected Overridable Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As EventArgs)
    If Not DesignMode Then
    Dim btn As Button = DirectCast(sender, Button)
    Dim tp As TabPage = CloseButtonCollection(btn)
    Dim ee As New CancelEventArgs
    RaiseEvent CloseButtonClick(sender, ee)
    If Not ee.Cancel Then
    Me.TabPages.Remove(tp)
    RePositionCloseButtons()
    End If
    End If
    End Sub
    Protected Overridable Function AddCloseButton(ByVal tp As TabPage) As Button
    Dim closeButton As New Button
    With closeButton
    '' TODO: Give a good visual appearance to the Close button, maybe by assigning images etc.
    '' Here I have not used images to keep things simple.
    .Text = "X"
    .FlatStyle = FlatStyle.Flat
    .BackColor = _BaseColour
    .ForeColor = Color.White
    .Font = New Font("Microsoft Sans Serif", 6, FontStyle.Bold)
    End With
    Return closeButton
    End Function
    Public Sub RePositionCloseButtons()
    For Each item As KeyValuePair(Of Button, TabPage) In CloseButtonCollection
    RePositionCloseButtons(item.Value)
    Next
    End Sub
    Public Sub RePositionCloseButtons(ByVal tp As TabPage)
    Dim btn As Button = CloseButtonOfTabPage(tp)
    If btn IsNot Nothing Then
    Dim tpIndex As Integer = Me.TabPages.IndexOf(tp)
    If tpIndex >= 0 Then
    Dim rect As Rectangle = Me.GetTabRect(tpIndex)
    If Me.SelectedTab Is tp Then
    btn.BackColor = Color.Red
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.Right - rect.Height + 11, CInt(rect.Y + 7))
    Else
    btn.BackColor = _BaseColour
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.Right - rect.Height + 11, CInt(rect.Y + 7))
    End If
    btn.Visible = ShowCloseButtonOnTabs
    btn.BringToFront()
    End If
    End If
    End Sub
    Protected Function CloseButtonOfTabPage(ByVal tp As TabPage) As Button
    Return (From item In CloseButtonCollection Where item.Value Is tp Select item.Key).FirstOrDefault
    End Function
    #End Region
    End Class
     In the Form`s code you can set the images for the TabPage icons like this.
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.TabPage1.Tag = Image.FromFile("C:\testfolder\img1.png")
    Me.TabPage2.Tag = Image.FromFile("C:\testfolder\img2.png")
    End Sub
    End Class
     Here is an example of what it looks like.
    If you say it can`t be done then i`ll try it
    Thanks :)) I tried you code and it works perfectly.
    Though i don't want the tabs have their width's by the size of form, so i fixed a width,
    If Me.Created AndAlso Me.TabCount > 0 Then
    'Dim tw As Integer = CInt(Me.ClientSize.Width / Me.TabCount)
    'Dim offset As Integer = Me.TabCount
    'If Me.ItemSize.Width <> tw - offset Then Me.ItemSize = New Size(tw - offset, 32)
    Me.ItemSize = New Size(200, 32)
    End If
    Here is the screenshot,
    I just don't know why the arrows (left and right) aren't full. here is a gif,
    Why is that :O Should I paint the arrows as well ?

  • HOWTO: Hide the delete button in a NavigatorBar

    HOWTO: Hide the delete button in a NavigatorBar (JSP)
    Goal: Hide the delete button in a NavigatorBar or JSNavigatorBar Data Web Bean. This example works for either bean.
    Solution: Edit the .jsp file containing your NavigatorBar bean. For a generated BC4J JSP application, the file is YourView_Top.jsp.
    Find the code that instantiates the NavigatorBar. It will look something like:
    <jsp:useBean class="oracle.jbo.html.databeans.NavigatorBar" id="tb" scope="request">
    <%
    tb.initialize(pageContext, "MyProject1_bizcomp_BizcompModule.MyView");At this point, add the following line of code to hide the delete button:
    tb.getButton(tb.NAVIGATE_DELETE).setButtonVisible(false);You can find the variable names for the other navigator buttons in the javadoc for oracle.jbo.html.databeans.BaseNavigatorBar. In the online help, this is under Reference -> Business Components Reference.
    null

    Georges,
    This has come up before, and after some experimentation, there's not a straightforward way to do it.
    There are two possible solutions that I can think of:
    1. Write your own custom bean and/or extend the beans provided to modify them to your needs.
    2. Wait for the 3.2 release at the end of the month. This release provides custom data tags with much finer grained control over specific items such as the buttons.
    I think 2 is preferable, if you have the time to wait.

  • Hide the DELETE button in EditCurrentRecord !!!

    Hi,
    Who can tell me how can I hide the DELETE button of the EditCurrentRecord ?
    Thank You !

    Georges,
    This has come up before, and after some experimentation, there's not a straightforward way to do it.
    There are two possible solutions that I can think of:
    1. Write your own custom bean and/or extend the beans provided to modify them to your needs.
    2. Wait for the 3.2 release at the end of the month. This release provides custom data tags with much finer grained control over specific items such as the buttons.
    I think 2 is preferable, if you have the time to wait.

  • How to suppress Save As dialog when using the Close button on an editable pdf

    Environment: Windows 7, SDK 9, Adobe Acrobat Pro X, Visual Studio 2010 Professional
    Summary: when a document is opened for editing using automation, edited, then closed using the "Close" button, the confirmation dialog appears, "yes" is selected and then the "Save As" dialog appears.  It should save without the "Save As" dialog in the same way it does were the document opened from Adobe Acrobat directly.  My question is, is there any flag to set which governs whether the "Save As" dialog appears as part of the close document process.  It is behaving as if the document is read-only upon close. (it isn't)
    This is how the document is opened from C++:
    if(SUCCEEDED(hr = ::CoCreateInstance(__uuidof(Adobe9::Acrobat::CAcroAVDoc), 0, CLSCTX_ALL, IID_IUnknown, (void**)&pUnk))){
    hr = OleRun(pUnk);
    if (SUCCEEDED(hr)){
    if (SUCCEEDED(hr = pUnk->QueryInterface(&pAVDoc))){
    hr = pAVDoc->Open((BSTR)CComBSTR(strPath), strDocName, &bRet);
    Even when the plugin is removed from the plug_ins\AcrobatSDK directory, the behaviour is the same.
    Another reproduction is running the BasicIacVC sample, commenting out all lines from gAcroPdDoc->Close(); in InitInstance() and returning TRUE.  If an editable document is opened using the sample, edited then closed using the "X" button, the confirmation dialog is followed by a "Save As" dialog as if it were a read-only document which it is not.
    Any suggestions would be appreciated.
    Regards,
    Evan

    Yes, it does.  (as long as the pdf has been opened via a COM interface)

  • Disable/Hide the Refresh Button in Child report

    Hi All,
    Our Environment is BOXI-R2;
    We have a Master Report calling a Child Report (based on Open Document);
    Our requirement is to hide the" Refresh Button "in the child report Layout
    we tried using "hideRefresh=true"
    but the child report is not responding to the above clause
    Help us in this,
    if this is a BUG in XI R2, let us know the Service Pack details
    Thanks

    Joe , Thanks for your Inputs..
    our master report has the aggregated Measure , when the user clicks on this , it has to open a child report (with paramters from master report).
    We are aware of customizing "viewer.js " file (under BO install home) with "refreshDocIcon = null".
    But is this the only solution to hide the refresh button in the child report ?
    SInce its already a PRODUCTION environment, our customer won't allow to change the standard settings of the product.
    Thanks

  • What should I do if the iphoto keeps on saying that "Plz wait for import to complete" when i click the close button but it is not importing photos? How can I close the iPhoto? I try to switch my mac off but it doesn't work. Thanks.

    What should I do if the iphoto keeps on saying that "Plz wait for import to complete" when i click the close button but it is not importing photos? How can I close the iPhoto? I try to switch my mac off but it doesn't work. Thanks.

    You should be able to select Force Quit from the menu beneath the Apple icon in Finder
    and choose to Quit iPhoto from there, without messing up the Mac OS X in the process.
    OS X - Support
    Not sure if rebuilding the iPhoto library would help this issue. However if you had to
    turn off the computer without the correct method (unplug, etc; instead of menu choice)
    the system may have accrued damages and should be checked, maybe repaired by
    use of the Disk Utility in the system. Or restart the computer in Safe Boot mode, then
    run 'repair disk permissions' while it is running in that reduced mode; then restart after.
    •Understanding Safe Mode - tuts+ computer skills tutorial:
    http://computers.tutsplus.com/tutorials/understanding-safe-mode--mac-59897
    •OS X: What is Safe Boot, Safe Mode?
    Suggestions on how to use Safe Mode in article, to resolve issues, may be helpful.
    There likely are other means to rectify troublesome applications, including reinstall.
    Be sure to backup your music, image, video, and other work on an external drive
    or suitable device as a precaution against loss should there be a hard drive failure.
    iPhoto - Mac Apps - Apple Support
    There should be some tips and help information using iPhoto via this tiny Support link.
    Good luck & happy computing!

Maybe you are looking for

  • My apple tv does not show up on itunes

    i pluged my apple tv 2nd generation into my computer and it didnt show up in itunes

  • Can I add a second device to my iTunes account but keep the downloads from each separate

    I have family plan with provider and have added a phone for a family member. Is it possible to make purchases from the app store on the new device but charge my itunes account? If so, would those downloads be shared between devices or could they be k

  • How do I import my favourites folder in my effects bin to new fcp?

    Hi guys, I'm currently running FCP on my new MacBook Pro, and have successfully imported my keyboard layout and effects from the FCP on my old mac to my new one. However, my favourites folder in my effects bin is empty, and I can't work out how to co

  • TS4526 Apple TV 5.2.1

    I have updated to 5.2.1 and restarted Apple TV, but Movies still returns to the Home screen. Are any other fixes available?

  • Leopard freezing

    I installed Leopard onto my Macbook (from Tiger) and now the Leopard system keeps freezing on me (i get a message saying Mac OS X has quit unexpectedly), forcing me to restart by holding down the power button. I never had this problem with Tiger. Any