Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
UltraMessageBox Title Bar Icon
posted

Hi,

I want the icon for UltraMessageBox like WinForms title bar icon. I have seen the previous post http://ko.infragistics.com/community/forums/t/44081.aspx for the same and does the steps suggested by your team member but doesn't seem to work. Please Can anyone help me out of this. This is too much important an urgent. The sample code is here.

Dim sMessage As String = String.Empty

Dim ulMessageBoxManager As New UltraMessageBoxManager

Dim objMessageInfo As New UltraMessageBoxInfo

objMessageInfo.Buttons = MessageBoxButtons.OK

objMessageInfo.Icon = MessageBoxIcon.Information

objMessageInfo.Caption = "Message"

objMessageInfo.TextFormatted = " <a href='" + My.Application.Info.DirectoryPath + "\MyLog.log'> " + My.Application.Info.DirectoryPath + "\MyLog.log</a>"

objMessageInfo.ButtonAlignment = Infragistics.Win.HAlign.Center

objMessageInfo.Style = Infragistics.Win.UltraMessageBox.MessageBoxStyle.Standard

objMessageInfo.ShowHelpButton = Infragistics.Win.DefaultableBoolean.False

If i call ulMessageBoxManager.ShowMessageBox(objMessageInfo), it works fine but it doesn't have title bar icon.

Dim objAssembly As Assembly = Assembly.Load("Infragistics2.Win.v10.3")

Dim objType As Type = objAssembly.GetType("Infragistics.Win.UltraMessageBox.MessageBoxDialog")

Dim objMethodInfo As MethodInfo = objType.GetMethod("InitializeDialog")

Dim objReturn As Object

Dim objParams(0) As Object

objParams(0) = objMessageInfo

Dim ObjData As Object = objMethodInfo.Invoke(objReturn, objParams)

Dim objMsgBoxDialog As Form = DirectCast(Activator.CreateInstance(objType), Form)

objMsgBoxDialog.Text = "This is form text."

objMsgBoxDialog.Icon = My.Resources.MyIcon

objMsgBoxDialog.ShowDialog()

Thanks.

Parents
No Data
Reply
  • 48586
    Verified Answer
    posted

    Hello  Ashish,

     

    I’ve translated Chris’ code to VB.NET and combined with your code snippet and everything works, please see attached sample. What I’ve notes is that you call Assembly.Load() instead of Assembly.GetAssembly(…) as Chris suggested. So I assume that because of this you are not able to achieve your goal.

     

    Please let me know if you have any further questions.

    TitleBarIcon.zip
Children