2

Is it possible to create a message bar popup(present in QGIS) in ArcMap, instead of shooting users with MessageBoxes?

I am not expecting any code examples. Guide me on the approach if this is possible.

enter image description here

8
  • Where have you looked when trying to answer your own question prior to posting? What does QGIS call "something like this"?
    – PolyGeo
    Aug 7, 2016 at 8:00
  • @PolyGeo - "something like this" edited to message bar
    – vinayan
    Aug 8, 2016 at 4:48
  • 1
    Do you mean the ArcObjects equivalent to qgis.org/api/classQgsMessageBar.html? I think the close voters are looking for a code snippet. You say not to expect one but they apparently do.
    – PolyGeo
    Aug 8, 2016 at 5:15
  • 2
    I think your question will be better received if it starts to contain some code that illustrates what you have tried to do to address what you suspect may be a major customization. Otherwise your question reads like "Here is something that I think will be very difficult to do. Can you show me how to do it? I won't offer any code to try and help you help me."
    – PolyGeo
    Aug 8, 2016 at 5:40
  • 2
    You can shoot your messages into a textbox in an open form, if not open then open it first.. doing such is based on your language and has nothing to do with ArcGis so is therefore off-topic. If you're attempting this in ArcObjects @PolyGeo is quite right in asking for code, any code, as it shows potential helpers where you're up to, what language you're using (C++, C#, VB6, VBA, VB.net) and what level of understanding you have. Aug 8, 2016 at 6:02

2 Answers 2

5

I would recommend to develop an ESRI AddIn in C# for example. There you can use an ESRI.ArcGIS.Framework.IDockableWindow. You could pin it to the top. The corresponding System.Windows.Forms.UserControl can be designed according to your wishes. You can show or hide the IDockableWindow and the messages in your custom code.

1
  • 2
    And implement a public method 'ShowMessage' (or similar) in your dockable window which can be called from any user code.. Just reference your dockable window in your code and it becomes a reusable class. you don't want to be accessing form objects directly, that causes problems with threads and protection levels but a public method that modifies a form object is quite ok... I've done this before on a C# tool (OnKeyDown event) to call the Click method of another open VB.net form. All of this has nothing to do with ArcGis though. Aug 9, 2016 at 1:40
4

You can write messages to the application status bar just as any other button on any toolbar in ArcMap does. If that is what you want? Creating that popup message bar you show in your question would be a major customisation of the application and I'm not sure that is possible.

The sample VBA code below shows you how to write messages to the application statusbar, be aware as soon as you move your cursor over other buttons or some other event has triggered then the message is overwritten.

Public Sub ShowMessage()
    Dim pApp As IApplication
    Set pApp = Application
    Dim pStatusbar As IStatusBar
    Set pStatusbar = pApp.StatusBar
    pStatusbar.Message(0) = "LOOK AT THE BOTTOM OF THE APPLICATION WINDOW, SEE ME!"
End Sub
1
  • i know about the status bar. This is not what I have in mind..i know that this will be a major customization :)
    – vinayan
    Aug 8, 2016 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.