|
Using Visual Studio 2005, I'm creating an application with floating tool bars similar to that of Photoshop (or most any application with floating tool bars) that share focus amongst each other. I have my tool bars in separate forms, and I call form.Show(ownerForm), to display the toolbar, where ownerForm is the main application's form. The problem is that only one form, the application's main form or the tool bar, can have focus at a time. Is there a property or method I can call to give focus to both the tool bar and the application's main form at the same time?
Skip
|
|
|
|
|
i think if you develop the toolbar as a usercontrol not as a frame it will give you an advantage. cz if you did it as a user control and add it to the first frame it will be as any normal control in your frame. this will allow you to have a double focus. you can drag and drop from it and .........
i am not very sure about the idea i gave you but i think it will be a starting point for you.
good luck
|
|
|
|
|
In VS2005 C#,How to make first item of the Combobox as default selection?
I have tried Combobox.selectedIndex=-1.But its not working.
Is there anyother way?
Thanks in advance
|
|
|
|
|
aruna_koride wrote: I have tried Combobox.selectedIndex=-1.But its not working.
What about:
SelectedIndex=0;
???
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Setting the SelectedIndex property to 1 deselects the currently selected item (if any). Use a value of zero to select the first item.
/ravi
|
|
|
|
|
Hi,
Setting the SelectedIndex to -1, will lead to a blank text being displayed as the first item of the dropdown combo. Instead try with setting SelectedIndex = 0;
this.dropdown1.SelectedIndex = 0;
might help u out.
Thanking you in Advance
Regards
Pratik Shah
|
|
|
|
|
How do i access Access Control List on a directory in windows 2000 in C#
|
|
|
|
|
Check out this article[^] from MSDN that goes over how it's done.
|
|
|
|
|
Hi
I developed application using VS2005.I have few questions about UI,
1. I have used the icons provided by the VS2005 to resize the buttons and text boxes.But,now I could not move the controls.Its very hard to even insert or resize a new control, what could be the problem?
2.I have used tabControl with tabPage collection,I changed the backcolor of tabControl , but tabpage buttons still system-color,I am not able to change their color or nor resize them.
3.I have developed an instant messaging application, can I prompt the user using mini icons at bottom of PC when the message comes? how to do that?
|
|
|
|
|
1. ?
2. You can't change the colour/ size of the tabs by default. There are some extended TabControl 's about. Google it.
3. You'll want the NotifyIcon control for this.
|
|
|
|
|
Hello everyone! I have experienced problems with setting the connection string when I try to connect to a file of type DBF (dBase, FoxPro) and OleDbCommand for the insert statement (both by code). I use Visual Studio 2003? Can anybody help me to manage with this?
the source is c:\myTable.dbf
the insert statement:
use myTable
insert into myTable(someColumn)
values ('string')
Thanks in advance!
|
|
|
|
|
|
I know I've read it somewhere here, but I can't seem to find it (now that I'm looking for it).
I want to catch a keystroke outside of the program (like, if a different program is focused and I want to hit a key, like F12 or something, and have my program act on it while minimized). Can someone point me in the right direction please?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
well, google 'global hooks'
here's some useful articles:
http://www.codeproject.com/csharp/globalhook.asp
http://support.microsoft.com/kb/318804
|
|
|
|
|
You rock. Thank you!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
No problem, I'm glad i could help (and now i wish someone could answer my thread >_<)
|
|
|
|
|
Hi,
I'm currently stuck with the following problem:
<br />
<br />
XmlSerializer tSer = new XmlSerializer(typeof(Int16[]);<br />
<br />
This generates an FileNotFound error. It's obviously an problem whith the OnTheFly generation of the serializer dlls and happens with each Array declaration at the moment. I found some stuff on the net dealing with this, but no real solution for my problem. I tried to track it down with the XMLPreCompiler, but until now with no success.
The funny thing is, that this error seems only to happen on the first stage, as the array occurs in the written XML file.
Does anybody have a clue, how to deal with Arrays and the .Net 2.0 XMLSerializer ?
Thanks in advance,
Florian
|
|
|
|
|
Florian Storck wrote: I'm currently stuck with the following problem:
I don't get that problem at all with that instantiation. It just returns an XmlSerializer object.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Hi Marc,
do you use .Net 2.0 ? Can you post a code example ? Maybe there are some prerequisites in my project causing this error.
Thanks,
Florian
|
|
|
|
|
Yes. .NET 2.0
Here's the little test app I wrote:
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
namespace XmlSerializerTest
{
class Program
{
static void Main(string[] args)
{
XmlSerializer ser = new XmlSerializer(typeof(Int16[]));
TextWriter writer = new StreamWriter("foo.xml");
Int16[] iArray = new Int16[] { 1, 2, 3, 4 };
ser.Serialize(writer, iArray);
writer.Close();
}
}
}
and it generates:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfShort xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<short>1</short>
<short>2</short>
<short>3</short>
<short>4</short>
</ArrayOfShort>
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Hi,
I tried it in an completely empty project, and it doesn't happen there. So there seem to be some project dependencies...looks like I have to track it down there..
Florian
|
|
|
|
|
Florian Storck wrote: looks like I have to track it down there..
Walk through the inner exceptions. That often reveals the real reason for the serializer to die.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Hello Marc,
some other strange thing is, that the VisualStudio catches the Exception, but I don't get the Exception in my own exception handler. Even if I switch off all Exception in Debug->Exceptions in VS, the Exception handler isn't called.
<br />
if (m_dicXmlSerCache.ContainsKey(TObj))<br />
{<br />
m_dicCacheHits[TObj]++;
return m_dicXmlSerCache[TObj];<br />
}<br />
else<br />
{<br />
XmlSerializer tSer = new XmlSerializer(TObj);<br />
m_dicXmlSerCache.Add(TObj, tSer);<br />
<br />
m_dicCacheHits.Add(TObj, 1);<br />
<br />
tSer.UnknownAttribute += new XmlAttributeEventHandler(XML_UnknownAttribute);<br />
tSer.UnknownElement += new XmlElementEventHandler(XML_UnknownElement);<br />
tSer.UnknownNode += new XmlNodeEventHandler(XML_UnknownNode);<br />
tSer.UnreferencedObject += new UnreferencedObjectEventHandler(XML_UnreferencedObject);<br />
return tSer;<br />
}<br />
}<br />
catch (Exception e)<br />
{<br />
m_Log.ErrorFormat("Error in SerializerCache: {0}", e.Message);<br />
}<br />
For explanation:
This Code acts as a cache for various serializer objects, to avoid unnecessary instantiations.
I've no real idea, why also my exception handler doesn't work here...
Bye,
Florian
|
|
|
|
|
Where's the try?
Anyways, I get the impression that the exception is happening in one of your tSer event handlers. Do you have try-catch blocks in the handlers?
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Oops,
<br />
try<br />
{<br />
if (m_dicXmlSerCache.ContainsKey(TObj))<br />
{<br />
m_dicCacheHits[TObj]++;
return m_dicXmlSerCache[TObj];<br />
}<br />
else<br />
{<br />
XmlSerializer tSer = new XmlSerializer(TObj);<br />
m_dicXmlSerCache.Add(TObj, tSer);<br />
<br />
m_dicCacheHits.Add(TObj, 1);<br />
<br />
tSer.UnknownAttribute += new XmlAttributeEventHandler(XML_UnknownAttribute);<br />
tSer.UnknownElement += new XmlElementEventHandler(XML_UnknownElement);<br />
tSer.UnknownNode += new XmlNodeEventHandler(XML_UnknownNode);<br />
tSer.UnreferencedObject += new UnreferencedObjectEventHandler(XML_UnreferencedObject);<br />
return tSer;<br />
}<br />
}<br />
catch (Exception e) <br />
{<br />
m_Log.ErrorFormat("Error in SerializerCache: {0}", e.Message);<br />
}<br />
I didn't post the whole block. I think the handler are not the problem, this also happened before i wrote this cache object, which attached no handler at all. I also had the problem, that the try-catch didn't worked, only the VS handler shows up. But I have to access to the exception object there, so I can't check the inner exceptions. Something weird seems to happen here...
Bye,
Florian
|
|
|
|