|
public class ExRichTextBox : System.Windows.Forms.RichTextBox
{
// variable declarations
private ExRichTextBox() : base()
{
// some logic
}
public ExRichTextBox(string _lang, string _projName) : this()
{
// some logic
}
// public and private methods
}
is it advisable?
please guide
|
|
|
|
|
Yes, but as Christian said, it wont work in the designer anymore... (does any real coder use the designer anyways? )
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
does any real coder use the designer anyways?
LOL - do you lay out GUI's by trial and error ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
LOL - do you lay out GUI's by trial and error ?
No, I normally think about it 1st...
top secret xacc-ide 0.0.1
|
|
|
|
|
You visualise the whole thing in your head ? I'd rather think about it by moving things in the designer until they look good.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
yeah, I think about the layout while i code some other stuff, it not that hard, just dont start your app with a GUI and build one as you need to expose functionality. Then you dont need to worry about the designer adding silly variables (like autoscalebasesize, that messes up borderless forms) etc, or changing your images in the imagelist from png to memory bmps (that lose transparency)... and if you wanna really love the UI designer u have to make all your controls also nice and friendly, tedious and redundant.
Gimme intellisense and im happy
top secret xacc-ide 0.0.1
|
|
|
|
|
Hi Guys,
I'm trying to write a server control that exposes as one of it's properties an object.
I've created a TypeConvertor that converts from a string representation to an instance of my object, and have also implemented the converstion from the object to an InstanceDescriptor.
When I create the InstanceDescriptor, I am passing in the parameters for the default no argument constructor of my object, and the third parameter to specify that the object can not be fully created from the InstanceDescriptor - which should force the serializer to output code for the properties of my object as well....
return new InstanceDescriptor( XmlDocType.GetConstructor( System.Type.EmptyTypes ), null, false);
However the code that is generated for the asp.net does not have any code for setting the propertiess of my object.
I know I could just create a constructor that takes in the values, and return the relevant InstanceDescriptor, but I would like to get it working the other way first. Does anyone know if this is possible, and where I could be gonig wrong?
Also I've looked at implementing my own CodeDomSerializer for my object, but cannot get the asp.net to actually call my implementation - again if any knows where I am going wrong with this, would be helpful to hear from you.
Thanks.
Chris.
|
|
|
|
|
How can I build a string with the string builder with new lines in it...?
foreach(string line in mail.LOGIN(user, pass))
{
sb.Append(line);
}
Right now I go like this... I would like to add a "\n " after line , but it dosn't complie. How can I add each line to a new line in the string?
/\ |_ E X E GG
|
|
|
|
|
Use Environment.NewLine
foreach(string line in mail.LOGIN(user, pass))
{
sb.Append(line);
sb.Append(Environment.NewLine);
}
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Ahh, that's it. Thanks.
/\ |_ E X E GG
|
|
|
|
|
Environment,NewLine is how you should add newlines, not with \n or \r\n. I don't see why that wouldn't work in a stringbuilder.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
thanks..............................................................
/\ |_ E X E GG
|
|
|
|
|
The StringWriter class is an overlooked gem, providing a TextWriter on a StringBuilder. Have a look
top secret xacc-ide 0.0.1
|
|
|
|
|
Never heard of it. I'll check it out.
/\ |_ E X E GG
|
|
|
|
|
I'm working on a project to send SNMP to a device. I can create the UDP/IP packet and even send it to the correct port. I just can't get the body correct. I don't know how to set the version, community, etc... I know there are some .dll's availble and even WMI but I can't use the .dll's due to potential licensing issues and I don't want to get mixed up with the whole WMI thing. Any help or sujestions would be great.
-Toby
Bad spellers of the world Untie!!
|
|
|
|
|
I found this Article helpful with some SNMP stuff I was working on. I'll pass it on.
http://www.c-sharpcorner.com/Code/2002/Sept/SnmpLib.asp
|
|
|
|
|
Let's say I have this url in a webpage...
http://asdf.com/index.aspx?userid=alex&password=9696
How can I read the 2 variables from a C# asp.net page?
/\ |_ E X E GG
|
|
|
|
|
You should be able to read them by doing something like this... Request.QueryString["userID"]
|
|
|
|
|
Thanks, that worked good. Do you know how to keep the connection open on a page?
/\ |_ E X E GG
|
|
|
|
|
Keep the Connection of a page open? You can't.
What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What connection? Database Connection? Connection to the Web Server?
If Web Server connection, you really can't (as far as I know anyway)...HTTP is stateless, the server pretty much serves up your page and forgets that you exist. That's why we have to maintain session state through things like the query string, hidden form field, session variables, etc...
If Database Connection, it's highly recommended that you don't keep the connection open any longer than is necessary.
I hope I've answered your question, but if not email me back with a clearer description and I'll make a best effort to help you out.
|
|
|
|
|
Do you know how to add a QueryString to the url, from the aspx code?
/\ |_ E X E GG
|
|
|
|
|
You can manually add the QueryString when you have a button or a link that redirects to anew page.
For example, from the code behind you'd do something like
request.redirect("http://www.somewhere.com/somepage.aspx?myvar=val1&myvar2=val2")
from javascript you'd do something like
window.location("http://www.somewhere.com/somepage.aspx?myvar=val1&myvar2=val2")
Keep in mind the security issues that may come from using the query string, and also that there is a max length (I don't remember what it is).
|
|
|
|
|
I'm working on a database centred program, and I have written a program which runs all my SQL scripts to install the database. My problem is, if I want to do a clean install, dropping the database often fails because there are users connected. So is there a way I can programatically drop all active connections to a database, so I can delete it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|