Hi,
I'm wondering if it could be possible to add an auto close functionnality on RadMessageBox ?
- With a formattable string like this : "Popup will close in {0} seconds"
- We should be able to specify a duration in seconds
- It would only be useable if the MessageBox is not a YesNo(Cancel)
Using an internal timer, the MessageBox would update the formattable string at each tick.
I think it can easily be achieved.
Thanks.
Here is some sample code:
Imports Telerik.WinControls
Imports Telerik.WinControls.UI
Public Class RadForm1
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
RadOverlayManager.Show(Me)
For x = 0 To 1999999999
Next
RadOverlayManager.Close()
RadMessageBox.Show("You will never see this.", "Nope", MessageBoxButtons.OK, RadMessageIcon.Info)
End Sub
End Class
What you'll see is, the overlay will appear and disappear as expected. However the radmessagebox will never appear.
If you comment out the overlay lines, then the message box will appear.
Looks like a threading issue, but I'll leave that to the professionals to figure out. =)
I did a search and found this thread from... 13 years ago: https://www.telerik.com/forums/radmessagebox-focus-on-buttons-in-mdi-app
Wasn't sure if I should necro it or not, but regardless, is there a way around this? For example, when I do a .Show on it I expect it to have focus and also that a button on there have focus. Especially if its just an "ok" button, as with the default .NET msgbox I could just hit the spacebar to continue. As it is, you HAVE to use your mouse to select the button.
Also, there's no TAG for the radmessagebox here on the forum so I used "messageBox"
Hi,
I'm having issues in my application when displaying and moving RadMessageBox from HD screen to 4K screen. The size of the default icon is very small when shown on the 4K monitor also the location of the buttons seems to go awrywhen moving dialog between monitors. I also get a strange sizing issue when showing a custom bitmap for an image, it's not scaling at all when shown on the 4K monitor.
Luckily the scaling / layout issues can be easily reproduced using the latest Demo Application (Demo Application - Telerik UI for WinForms R2 2022 SP1) by following these steps.
On the HD monitor - start demo app, select Explore all controls, select "Message Box"
Change message type to "Info" and set buttons to "Yes, No, Cancel"
Click "Show RadMessageBox" - Message box is displayed as expected
Drag to 4K monitor - size and layout is wrong and icon image is small
Press cancel whilst its shown on 4K monitor
Click "Show RadMessageBox" - Message box is displayed on HD monitor with overlapping buttons and large image icon
Press Close / cancel and try again - this time it shows correctly
Sometimes when playing with the demo I get also see
and
I'm aware that RadMessageBox is persistant throughout the life of the applicationso you might have to shut down the demo app and restart it.
And another issue, this time starting in my own HDPI aware application on 4K monitor - this time the size of the message text is too large.
Kind regards
Toby
Hi,
I'd like to customize the location of a MessageBox. Ideally, I would just set a parent control and the MessageBox would center itself to the parent.
I tried this ((0,0) to make it obvious) but it doesn't work:
'Dim pt As Point = New Point(Me.Parent.Location.X + Me.Location.X, Me.Parent.Location.Y + Me.Location.Y)
'Telerik.WinControls.RadMessageBox.Instance.Location = New Point((pt.X + Me.Width / 2) - (Telerik.WinControls.RadMessageBox.Instance.Width / 2), (pt.Y + Me.Height / 2))
Telerik.WinControls.RadMessageBox.Instance.Location = New Point(0, 0)
Dim ds As DialogResult = Telerik.WinControls.RadMessageBox.Show(Me, "Are you sure?", "Clear form",
MessageBoxButtons.YesNo, RadMessageIcon.Question,
MessageBoxDefaultButton.Button1)
I've also found this bit of code (modified it according to my needs) from an older answer to someone else's similar question:
Private Sub Instance_LocationChanged(sender As Object, e As EventArgs)
RemoveHandler RadMessageBox.Instance.LocationChanged, AddressOf Instance_LocationChanged
Dim box As RadMessageBoxForm = sender
Dim pt As Point = New Point(Me.Parent.Location.X + Me.Location.X, Me.Parent.Location.Y + Me.Location.Y)
box.Location = New Point((pt.X + Me.Width / 2) - (box.Width / 2), (pt.Y + Me.Height / 2))
AddHandler RadMessageBox.Instance.LocationChanged, AddressOf Instance_LocationChanged
End Sub
But the problem here is that the MessageBox is then static and can't be moved.
Suggestions?
Using version 2021.1.326.40.
Jure
Ok, this one's just weird. The Close (X) button on MessageBox's TitleBar is not working. I click on it and nothing happens.
ds = Telerik.WinControls.RadMessageBox.Show(Me, "Are you sure?", "Clear form", MessageBoxButtons.YesNo, RadMessageIcon.Question, MessageBoxDefaultButton.Button1)
Help.
Edit: interestingly, it's the same with regular (native) MessageBox. As if the button is disabled. But why even show it then?
Hi everyone,
when a radmessagebox pops up , its not exactly on the center of screen .
How to align it to the center of screen?