Print Page | Close Window

CommandbarEdit control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11209
Printed Date: 07 October 2024 at 6:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandbarEdit control
Posted By: Nutty101
Subject: CommandbarEdit control
Date Posted: 25 June 2008 at 3:49pm
What is the correct method to obtaining the text in the box from the xtpControlEdit object? I have tried casting it to every possible thing out side the ControlEditClass (That has the .text item). Nothing else does.

                        CommandBarControl oItem = ax_CmdBarMDI.FindControl(CodeJock.cCommandBarIDs.ID_CALLCONTROL_NUMBERDIAL);

I have tried
                        CommandBarControl oItem = axCommandBars1.FindControl(CodeJock.cCommandBarIDs.ID_CALLCONTROL_NUMBERDIAL);
                        CommandBarEdit Oitm1 = (CommandBarEdit)axCommandBars1.FindControl(CodeJock.cCommandBarIDs.ID_CALLCONTROL_NUMBERDIAL);
                        CommandBarEditClass Oitm2 = (CommandBarEditClass)axCommandBars1.FindControl(CodeJock.cCommandBarIDs.ID_CALLCONTROL_NUMBERDIAL);

Can't cast to the class but hey at least i tried. laugh.
                       




Replies:
Posted By: Aaron
Date Posted: 26 June 2008 at 12:31am
Hi,
 
You want only the text entered in edit part?
This is a sample in VB, maybe it will help you:
 
txtText = CommandBars(1).FindControl( , ID_TOOLBAR_FILTERTEXT).Text
 
I believe the method would be the same but I don't see a comma in your line, is this correct?
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 26 June 2008 at 1:32pm
In c# i don't have the option of only two.

        public virtual CommandBarControl FindControl(int id);
        public virtual CommandBarControl FindControl(object type, int id, object visible, object recursive);

are the only options. I can find the control, but .text is never part of the class. I see it in the CommandBarEditClass but not the CommandBarEdit. I am going to assume that i am missing something simple.


Posted By: Aaron
Date Posted: 26 June 2008 at 3:46pm

Hi, 

Try this first and ask later
 
axCommandBars1(1).FindControl(object type,CodeJock.cCommandBarIDs.ID_CALLCONTROL_NUMBERDIAL).Text;
 
 
(1) = index of added commandbar to CommandBars
ID_CALLCONTROL_NUMBERDIAL = ID of Control added to the commandbar(1)


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 26 June 2008 at 4:15pm
Think the vb ax wrapper has something i don't. Cant do two arguments and no array of commandbar controls to access. Since i only have a single instance. I can get the control and cast it to the edit control and what not, just no ability to access the .text property.


Posted By: Nutty101
Date Posted: 26 June 2008 at 4:17pm
According to the documents the CommandBarEdit object should have a .text. However the demo does not. Maybe a limitation who knows. Only have till July 11th for the trial and need to see if this thing will really do what is needed.


Posted By: Aaron
Date Posted: 26 June 2008 at 4:33pm
Hi,
 
Do you add commandbar to commandbars or activemenubar. How do add the editcontrol. Can you give me a sample how you do this?
 
I can't stand if I'm not able to help you, even when you have a different language


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 26 June 2008 at 6:15pm
I used the designer to create everything. Im lazy and in a hurry. Tried the activex a long time ago but they decided not to continue until we replaced the phone system. So now we have a new system and i have to have a working model to demo soon for a new client. Have two gui components i am testing with. I just like the codejock suite better.

The commandbars are on a MDI form:

internal AxXtremeCommandBars.AxCommandBars axCommandBars1;

this.axCommandBars1 = new AxXtremeCommandBars.AxCommandBars();
            this.axCommandBars1.Enabled = true;
            this.axCommandBars1.Location = new System.Drawing.Point(26, 22);
            this.axCommandBars1.Name = "axCommandBars1";
            this.axCommandBars1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axCommandBars1.OcxState")));
            this.axCommandBars1.Size = new System.Drawing.Size(24, 24);
            this.axCommandBars1.TabIndex = 1;
            this.axCommandBars1.Execute += new                         AxXtremeCommandBars._DCommandBarsEvents_ExecuteEventHandler(this.axCommandBars1_Execute);







Posted By: Aaron
Date Posted: 27 June 2008 at 1:47am
Hi,
 
I ment how you add the editControl to commandbar. But I see you have an execute event handler
 
 
Try this:
 

private void CommandBars_Execute(object sender, AxXtremeCommandBars._DCommandBarsEvents_ExecuteEvent eventArgs)

{

switch (eventArgs.control.Id)

{

case ID.YOUR EDIT ID:

MessageBox.Show(eventArgs.control.Text + " clicked", "Edit text");

break;

}

}

 

If you added the control correctly, you see the text you entered.

 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 27 June 2008 at 9:36am
Dunno. It's just not there. Gotta be something with the demo control then or I am just loosing it. Here is the version screen and a shot of the class from vs2008.



Posted By: Aaron
Date Posted: 27 June 2008 at 9:59am
Hi,
 
With VB it doesn't show neither just try it anyway.


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 27 June 2008 at 10:23am
Can't compile. :(


Posted By: Aaron
Date Posted: 27 June 2008 at 10:50am
Hi,
 
Strange ???? With VB it doesn't show but it works. Same as with a commandbar combobox (listindex) doesn't show but it works. Think you have to shout for someone who is really into C#
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Nutty101
Date Posted: 27 June 2008 at 10:52am
Btw thanks for trying to help with this. 


Posted By: SuperMario
Date Posted: 27 June 2008 at 11:51am
Add this to C# Ribbon Execute Event and select different fonts in the Home tab:

                case ID.ID_FONT_FACE:
                    XtremeCommandBars.CommandBarComboBox myCombo =
                        eventArgs.control as XtremeCommandBars.CommandBarComboBox;
                    MessageBox.Show(myCombo.Text + " clicked", "Button Clicked");
                    break;   


Posted By: Nutty101
Date Posted: 27 June 2008 at 1:49pm
uugh, it was using the AS to cast it. Many many thanks as this resolved it.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net