|
There is a sorted listbox[^] on CP which may be what you're looking for.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
I have a simple project where I've derived my own class from System.Windows.Forms.TextBox. Then, in the same project, I created a form, added a textbox to it, and changed the type from TextBox to MyTextBox (my class name). It all compiles and builds fine. But when I try to open the form in Design mode, I get an error:
System.Runtime.Serialization.SerializationException: Could not find type 'MyTextBox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of the your development project, make sure that the project has been successfully built.
Then the form appears without the textbox on it. How can I solve this problem?
Thanks in advance!
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Never do what you just described.
1.If your custom textbox is defined within a class in the project, the best thing you can do is to add your derived textbox programmatically, i.e.,
MyTextBox mtb=new MyTextBox;<br />
<br />
mtb.Location=...
2. In order to be able to visually use your derived textbox at design-time, you must build your custom textbox as a user control. That way you will be able to reference it and put it in the toolbox.
|
|
|
|
|
I want to set version information for my c# application and then be able to extract it and display it in a about box at runtime.
Some of the information I need you can define in the assemblyinfo file associated with a solution
eg.
[assembly: AssemblyTitle("Gradient Volume Calculator")]
[assembly: AssemblyDescription("Solvent Calculator for use by AS Software")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("XYZ")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("© XYZ")]
[assembly: AssemblyTrademark("XYZ")]
[assembly: AssemblyCulture("")]
and then access it using the FileVersionInfo command below
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(sFilePath);
x := myFileVersionInfo.LegalCopyright.ToString();
You can also Get Productname, FileVersion and InternalName, etc.
But HOW do you set things like ProductName, FileVersion, InternalName, FileDescription and Comments.
Am I missing an assembly reference or something?
Thanks in advance
Satvinder Basra
|
|
|
|
|
Looks like the attribute names not match up with the VersionInfo string names directly. Here are a few I mapped out:
ProductName = [assembly: AssemblyProduct()]
ProductVersion = [assembly: AssemblyInformationalVersion()]
FileVersion = [assembly: AssemblyFileVersion()]
Commants = [assembly: AssemblyDescription()]
Burt Harris
|
|
|
|
|
program mystery
String x;
Boolean f;
integer a, z,g;
x = readinput
g = length of x
z = g minus one;
a = zero
if g = 1 then f = 1
else
f = 1;
while (f=1 and a less than z)
while character at a of x is one of [whitespace,comma,semicolon, or full stop]
a++;
while character at z of x is one of [whitespace,comma,semicolon, or full stop]
z--;
if the toUpperCase of character at a of x is identical to
the toUpperCase of character at z of x
then a++ and z--;
else f=0;
if f=0 then print out appropriate message
else print out other appropriate message
any help would be apreciated cheers tom
|
|
|
|
|
Why not write it?
Hey leppie! Your "proof" seems brilliant and absurd at the same time. - Vikram Punathambekar 28 Apr '03
|
|
|
|
|
public void DoesSomethingIKnowNotWhat()
{
string x;
bool f;
int a, z, g;
x = Console.ReadLine ();
g = x.Length;
z = g - 1;
a = 0;
if (g == 1)
{
f = 1;
}
else
{
f = 1;
}
while (f = 1 && a < z)
{
while (x.Substring (a, 1) == " " ||
x.Substring (a, 1) == ";" ||
x.Substring (a, 1) == ".")
{
a++;
}
while (x.Substring (z, 1) == " " ||
x.Substring (z, 1) == ";" ||
x.Substring (z, 1) == ".")
{
z--;
}
if (x.Substring (a, 1).ToUpper () ==
x.Substring (z, 1).ToUpper ())
{
a++;
z--;
}
else
{
f = 0;
}
}
if (f == 0)
{
Console.WriteLine ("Appropriate message");
}
else
{
Console.WriteLine ("Other appropriate message");
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Is there a nices way than this:
System.IO.Stream stream = irdaClient.GetStream();
int msglength = System.Net.IPAddress.HostToNetworkOrder(textBox1.Text.Length);
byte[] length = new byte[4];
length[0] = (byte)((msglength >> 0 ) & 0x000000FF);
length[1] = (byte)((msglength >> 8 ) & 0x000000FF);
length[2] = (byte)((msglength >> 16) & 0x000000FF);
length[3] = (byte)((msglength >> 24) & 0x000000FF);
stream.Write(length, 0, length.Length);
I think that the way with the byte array is not very nice! I think it's ugly !
The stream is a IrDA connection!
I have tried the StreamWriter class, but that doesn't work! The Server-Application receives some wrong things!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
If all you are trying to do is put the bytes of the int into the stream, why not use a BinaryWriter ?
This class has many overloads for Write().
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thanks! I will try it!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi there
I wonder how you play sounds(mp3) in C# in a good way?
|
|
|
|
|
It's possible to control WinAmp in order to play mp3s. There is some dll which allows you to do so.
Decoding mp3s is quite difficult I think and I read that you need an expensive licence to be able to access information about the internal format of mp3s. But I'm not quite sure
But WinAmp is freeware...
|
|
|
|
|
I made a ComboDataGrid (ParentControl). When the ComboBox (ChildControl) in the DataGrid has the Focus then I want to catch any Key Events from the ComboBox.
The ComboGrid should react as follows:
When the focused cell is not the ComboBoxColumn then the DataGrid should act normal, what means when the user presses Up or Down Arrows, the Focused Row chould change.
When the focused cell is in a ComboBoxColumn then it should be possible to press Ctrl+Up or Down Arrow to scroll up and down in the ComboBox.
To solve this I need any keyEvent of the ComboBox before the DataGrid. I tried with ProcessCmdKey(), ProcessKeyEventsArgs() but could not get what I wanted.
Big Thanks for all who will reply.
Stefan
|
|
|
|
|
I made a ComboDataGrid (ParentControl). When the ComboBox (ChildControl) in the DataGrid has the Focus then I want to catch any Key Events from the ComboBox.
The ComboGrid should react as follows:
When the focused cell is not the ComboBoxColumn then the DataGrid should act normal, what means when the user presses Up or Down Arrows, the Focused Row chould change.
When the focused cell is in a ComboBoxColumn then it should be possible to press Ctrl+Up or Down Arrow to scroll up and down in the ComboBox.
To solve this I need any keyEvent of the ComboBox before the DataGrid. I tried with ProcessCmdKey(), ProcessKeyEventsArgs() but could not get what I wanted.
Big Thanks for all who will reply.
Stefan
|
|
|
|
|
I am considering taking the plunge, and designing my first full fledged application in C# (WinForms). It will have a MDI and lots of menus and right click events.
What is the best way to fully plan out my design before coding? Besides the needs and must haves of the app, is there anything else i should take into consideration?
- I will be doing most of this with Visio, along with the trusty ol' pen & paper;)
Thanks,
Steve
McLenithan
Is Bert Evil?
|
|
|
|
|
Not to be silly but why not start by writing out a few use cases?
Also, if you can, try to avoid cramming all of your code into the On_Click() etc. style event methods as it tends to make the code less extensible and reusable. Invest some time into looking at using patterns like the "Command", "Mediator", "Event-Delegate/observer".
Also, look at Marc Clifton's AAL which is posted here on codeproject.
Some MS links are
http://msdn.microsoft.com/architecture/patterns/
http://msdn.microsoft.com/architecture/community/
Misc Links
http://www.cs.mu.oz.au/~moke/
And a discussion on GotDotNet
http://www.gotdotnet.com/community/messageboard/Thread.aspx?id=83782
Hey don't worry, I can handle it. I took something. I can see things no one else can see. Why are you dressed like that?
- Jack Burton
|
|
|
|
|
|
Is there a way for a server to get the client's IP address when using standard Remoting?
"If you just say porn then you get all manner of chaff and low grade stuff." - Paul Watson, Lounge 25 Mar 03 "If a man is standing in the middle of the forest speaking and there is no woman around to hear him, is he still wrong?" - Anon
Jonathan 'nonny' Newman
Homepage [www.nonny.com] [^]
|
|
|
|
|
uh I have this form, and then I have this form called about.cs, and I have this....
private void aboutClick(object sender, System.EventArgs e)
{
***OPEN ABOUT WINDOW HERE***
}
could somebody please fill this in... Thanksssssss.
/\ |_ E X E GG
|
|
|
|
|
What exactly are you trying to do with the Click?
Do you want to close the about window?
about.ActiveForm.Hide()
Is this where you are trying to open the about window?
Form aboutForm = new about();
aboutForm.Show();
It depends on what file the aboutClick() is in.
|
|
|
|
|
THanks... all I need was to know how to open the about form. thanks again.
/\ |_ E X E GG
|
|
|
|
|
if i lauch a child form from the main one like this:
FormOpen dlg = new FormOpen();
if (dlg.ShowDialog() == DialogResult.OK)
{
// stuff
}
how can FormOpen class gain access to member variables of the main form?
is there a method like AfxGetApp() for getting a ref to the main form?
|
|
|
|
|
You could just create a constructor for FormOpen that takes a form. That way you could just do:
FormOpen dlg = new FormOpen(this);
Then you can use the mainform just like any other object in your form.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
While creating a web component I ran into a problem with setting the properties for the Designer Property Pages.
One of my Properties can only be Top,Bottom,Left, or Right.
I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject.
|
|
|
|