|
POST
|
Thanks for the reply Duncan - I've been so busy workin on other parts of this project that I didn't see your reply until just now. I'm trying to work with ICommandBar to find and remove a button, but additional questions come up: 1. Is there a way within the button code itself to reference that button (something like Me) or do I have to find the commandbar and then the command (just looking for a shortcut). 2. Where do I run this code from? Ideally I just want the toolbar to appear without those buttons so the user doesn't know any better about what's missing. I've got other initialization code I've put into the New sub of one of the buttons on the toolbar. I tried to add the following code to the New sub on that button Dim commandBars As ESRI.ArcGIS.Framework.ICommandBars = clsGlobals.app.Document.CommandBars Dim barID As ESRI.ArcGIS.esriSystem.UID = New ESRI.ArcGIS.esriSystem.UIDClass barID.Value = "Test_Toolbar" Dim barItem As ESRI.ArcGIS.Framework.ICommandItem = commandBars.Find(barID, False, False) At runtime, when the code hits the last line, it generates this error: Catastrophic failure (Exception from HRESULT:0x8000FFFF (E_UNEXPECTED)) So, I guess this isn't the way to go! Is the toolbar created at this point? How do I access something like an addin AfterLoad type of event?
... View more
06-28-2013
09:26 AM
|
0
|
0
|
2095
|
|
POST
|
You know James, I've looked before trying to find where I check a reply as the answer and I never noticed the grayed out checkmark until right now when I looked again. Sorry I didn't mark your answer before!
... View more
06-25-2013
01:56 PM
|
0
|
0
|
697
|
|
POST
|
I'd like to hide some buttons on an addin toolbar. It appears that isn't possible - there are only Enable or Checked properties. First question - am I missing an easy way to hide an existing button on a toolbar? Second question - if there is no way to hide a button, does that mean I need to add/remove the button to the toolbar programatically? Can someone point me to a code sample to do this? My buttons need to be in a particular order, and the ones I need to hide/show are in the middle - is there a way to add a button in a particular location? Thanks for any help - I've been searching for code samples and failing to find examples of what I'm trying to do. update: - it occurs to me now that I only need to know how to remove a button. The buttons that should be shown depend on the particular user's level of access, and I know what that is when my addin initialization code is being run. So I can create the toolbar with all the buttons, and then just remove ones that shouldn't be there if the user shouldn't have access to that option. So I'm just looking for a code sample to show how to remove a button from a toolbar.
... View more
06-25-2013
01:52 AM
|
0
|
11
|
5873
|
|
POST
|
I have a custom Edit form which is also being used as the Identify form. The Edit form has an Edit box that is updated with the current feature's line length (taken from the feature's shape). My code updates this value when the user is editing an existing line or creating a new line. Here's my problem. If I Identify a line, my Edit box shows no value, as expected. If I then edit or create a new line, the Edit box updates with that line's length. Again, as expected. But if I now Identify another line, the previously displayed length of the line being edited/created is still visible in the Edit box. Everytime I edit existing or create new, the value updates correctly, but everytime I use Identify after the Edit form is opened, the last displayed value is shown in the Edit box. I can't just tie my Edit box to the Shape_Length field because I need to display it in a different unit of measurement. I originally tried to get the Identify form to update with that feature's correct length but Map.SelectionLayer generates an "Object required" error message when used with Identify. When that approach didn't work, I decided to try to clear out the value from the Edit box instead. I have tried everything I can think of to clear out the value of the Edit box - when the form is loading, when the form is unloading, when the Page loses focus - my code to update the Edit box text appears to be executed based on messages I display and doesn't generate any error messages, but once populated, the previously displayed value never clears when using Identify. How can I get this to work?
... View more
06-20-2013
08:25 AM
|
0
|
0
|
653
|
|
POST
|
Thanks James. I eventually figured it out and got my code working as needed, but it's good to get the answer out here, too.
... View more
06-13-2013
06:23 AM
|
0
|
0
|
697
|
|
POST
|
Don't know if you've discovered this yet, but you can use IN "Name" In ('A', 'B', 'C', 'D')
... View more
05-21-2013
07:15 PM
|
0
|
0
|
281
|
|
POST
|
I'm using VBscript. Is there a way to tell in my form load code if the edit form is being opened because the user is editing an existing feature vs creating a new feature?
... View more
05-09-2013
07:21 PM
|
0
|
4
|
1032
|
|
POST
|
One more note - the same shapefile and associated apl when used in ArcPad 7 works correctly - when creating a new feature, the form opens up with both checkboxes unchecked.
... View more
05-09-2013
04:50 PM
|
1
|
0
|
511
|
|
POST
|
I've been searching through the posted questions and seen similar questions posted before but none provided an answer. My question is very simple - I have a form with a checkbox and I want the form to open with the checkbox unchecked. I've set the default value to False. When editing an existing feature, the checkbox is correctly checked or unchecked based on the current values for the feature being edited. But when creating a new feature, the form always opens with the checkbox checked. I've got 2 checkboxes on different pages on the form, and both behave the same way. How do I fix this? Thanks for any help...
... View more
05-09-2013
04:24 PM
|
0
|
1
|
2401
|
|
POST
|
Unfortunately, I never figured out if there was a way to day this and now I can't remember what I did instead to get around it. Sorry I can't give you any more information than that.
... View more
10-26-2011
07:19 AM
|
0
|
0
|
691
|
|
POST
|
One line gets wrapped and a ( was dropped, so I want to be clear. The lines I added were: Dim cbx = ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID(Of clsLayerCombobox) (My.ThisAddIn.IDs.clsLayerCombobox) cbx.UpdateLayerList()
... View more
05-23-2011
02:15 PM
|
0
|
0
|
1103
|
|
POST
|
I figured it out. Here's what I did: In my combobox code, I have a sub named UpdateLayerList which adds layers in the data frame that contain a required field to the combobox. In my button code, I added the following to OnClick Dim cbx = ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID(Of clsLayerCombobox) My.ThisAddIn.IDs.clsLayerCombobox) cbx.UpdateLayerList() I had originally been close to the solution using the following Dim cbx As ESRI.ArcGIS.Desktop.AddIns.ComboBox = ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID(Of clsLayerCombobox)(My.ThisAddIn.IDs.clsLayerCombobox) which did not cause any compile errors, but at run-time it would cause an exit from the code without any error messages. It was when I couldn't get that to work that I posted my question and then tried the approach using ICommandItem. When that didn't work either, I searched some more and found sample code which I used and it works great. The difference is here Dim cbx = instead of Dim cbx As ESRI.ArcGIS.Desktop.AddIns.ComboBox = I may not understand exactly what is being returned here, but the code works, my layer list can get updated from my button correctly, and I'm happy. (In case you're wondering, there had been a problem in the past trying to update the layer list by listening to an update event for changes to the map, which is why we went with a button that the user clicks to update the list). I also used similar code to get to the text in another combobox (which I'm using as a text box on my toolbar) so it's been a good afternoon. Thanks for your responses.
... View more
05-23-2011
02:12 PM
|
0
|
0
|
1103
|
|
POST
|
Thanks for the response, Ken. I've added the code below to my button OnClick to find the ComboBox: Dim pUID As New ESRI.ArcGIS.esriSystem.UID Dim pCommandItem As ESRI.ArcGIS.Framework.ICommandItem pUID.Value = My.ThisAddIn.IDs.LayerCombobox pCommandItem = My.ArcMap.Application.Document.CommandBars.Find(pUID, False, False) But now what? The command item I'm looking for is a combobox. I want the button to update the contents of the combobox. I can't access the combobox directly from the button to clear its items and re-add them, and the only method on ICommandItem that seems to be appropriate is Execute, but what gets executed for a Addin Combobox?
... View more
05-23-2011
12:18 PM
|
0
|
0
|
1103
|
|
POST
|
I have an addin that contains a combobox, a button and a tool. I want the button to be able to update the combobox but cannot figure out how to properly get a reference to the combobox. Can someone give me a VB example? Thanks.
... View more
05-20-2011
01:20 PM
|
0
|
6
|
4878
|
|
POST
|
Thanks for posting your solution, Matt. I find these forums very difficult to search and find solutions, but after digging a while I came across your posting. I was trying to figure out how to access a combobox from a button in the same addin, and your answer got me there.
... View more
05-20-2011
11:35 AM
|
0
|
0
|
735
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-09-2013 04:50 PM | |
| 1 | 07-24-2014 02:13 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|