|
Hi
I think you are in wrong way.
There is no request to add checkbox to listbox control.
You can use CheckedListBox control, you can find it under listbox control in your toolbox.
Bye
|
|
|
|
|
But how can i do it in web application. there is no control like checkedlistbox ??
|
|
|
|
|
Hi Dear All Respected Programmers
Kindly let me know that, Is there any method of ConnectionString to connect with Oralce10g or (if any above 8x) database without installling Oracle client software or Oracle net?
Thank you in Advance
|
|
|
|
|
There is no way. You'll definitely need the client.
|
|
|
|
|
Well, if one can help - it would be nice!
I have a simple property that returns an object of class MyClass.
Within this property i defines the "get" as well as the "set" accessors.
Somthing like...
public MyClass MyPropertyName
{
get{return _myPropertyName;}
set{_myPropertyName = value;}
}
The "get" accessor, as we all know, returns a reference to the _myPropertyName, so outer code can easily change the _myPropertyName public fields.
The "set" accessor however change the whole object, that is, replace the current _myPropertyName with the specified "value" object.
The question:
Is it possible to lock the fields of _myPropertyName from changing when accessing them using the "get" accessor?
Ok, I know that i can define the "MyClass" fields as readonly fields and initialize them within the instance constructors, however, these field must be writeable in my application.
I also know that i can use internal field in "MyClass" that inidicates whether the instance is readonly and check this value whenever a property is gonna be changed by outer code.
What i looking for is a solution that eliminates the need of much code to handle this requirement.
Ok, if anyone faced the same requirement and solve this problem in ease way, and could post his solution - it would be nice.
Thanks in advanced, elaj.
|
|
|
|
|
The easy way to solve this:
public MyClass MyPropertyName
{
get{return _myPropertyName.Clone();}
set{_myPropertyName = value;}
}
They get a copy, so any changes are not reflected in your object.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Interesting and, in retrospect, obvious answer. I didn't think of that.
Thanks!
|
|
|
|
|
There is no way of making an object dynamically read-only wihtout logic in the class.
An alternative could be to make a wrapper class that only exposes the contents from the class as read-only. Example:
public class MyClassReader {
private MyClass _daClass;
public MyClassReader(MyClass daClass) {
_daClass = daClass;
}
public int SomeProperty { get { return _daClass.SomeProperty; } }
public string SomeOtherProperty { get { return _daClass.SomeOtherProperty; } }
}
Another alternative could be to make the properties virtual and make a class that inherits from MyClass and overrides the properties and throws an exception if the set accessor is used.
A bit of code in both cases, but both these alternatives has the advantage that it leaves the original MyClass unchanged (or mostly unchanged) and unaware of all the fuss.
---
b { font-weight: normal; }
|
|
|
|
|
I have MDI application.
when I open an application form with "show" function and suppose some process is going in that application form and close form.but
My Mdi application focus change with other windows task. how can I solve this problem?
|
|
|
|
|
I writ a code IN C# that print table + data to the printer.
I have laser printer with 64M memory.
but when I send to the printer about 500 pages I have a Problem.
about 50 pages the spooler of winXP start goes slowly.
what can I do ?
I have The Same code In VB and hi works More Good - but In WIN98.
Can I pass The spooler?
Can I writ The data to file and then send it to print?
can I save the table in "System.Drawing.Printing.PrintPageEventArgs"
and add to this event any time data????
Can I writ In PS???
|
|
|
|
|
I think it would be better to write the data in a file in RTF format. You can also add an RTF text box to you project to view you RTF document that is to be printed. Then add Print Dialogue to your RTF text box and in this way all the print commands will be controlled inside the project.
Mujtaba
|
|
|
|
|
How can I start With RTF ???
How It will help me to write the data to a file???
How can I print the data from the file , after I saved the file???
please HELP ME , I mast know some start of what you write to me.
galigal156
|
|
|
|
|
One simple way is that when you save text in RTF format you can then load it in MSWord or any other word processor and print them out. If you want to add RTF viewer or editor to your project then make a new form and add Rich text box to you form and by calling its methods you can manipulate all the things required.
Here is an example.
public void CreateMyRichTextBox()<br />
{<br />
RichTextBox richTextBox1 = new RichTextBox();<br />
richTextBox1.Dock = DockStyle.Fill;
<br />
<br />
richTextBox1.LoadFile("C:\\MyDocument.rtf");
richTextBox1.Find("Text", RichTextBoxFinds.MatchCase);
<br />
richTextBox1.SelectionFont = new Font("Verdana", 12, FontStyle.Bold);
richTextBox1.SelectionColor = Color.Red;
<br />
richTextBox1.SaveFile("C:\\MyDocument.rtf", RichTextBoxStreamType.RichText);
<br />
this.Controls.Add(richTextBox1);
}<br />
For printing checkout PRINTDIALOGUE properties. You have to bind the print dialogue to you page.
Here is an example.
<br />
private System.Drawing.Printing.PrintDocument docToPrint = <br />
new System.Drawing.Printing.PrintDocument();<br />
<br />
private void Button1_Click(System.Object sender, <br />
System.EventArgs e)<br />
{<br />
<br />
PrintDialog1.AllowSomePages = true;<br />
<br />
PrintDialog1.ShowHelp = true;<br />
<br />
PrintDialog1.Document = docToPrint;<br />
<br />
DialogResult result = PrintDialog1.ShowDialog();<br />
<br />
if (result==DialogResult.OK)<br />
{<br />
docToPrint.Print();<br />
}<br />
<br />
}<br />
<br />
private void document_PrintPage(object sender, <br />
System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
<br />
<br />
string text = "In document_PrintPage method.";<br />
System.Drawing.Font printFont = new System.Drawing.Font<br />
("Arial", 35, System.Drawing.FontStyle.Regular);<br />
<br />
e.Graphics.DrawString(text, printFont, <br />
System.Drawing.Brushes.Black, 10, 10);<br />
}<br />
<br />
<br />
Mujtaba
|
|
|
|
|
But now how can I print a table in this file ? ? ?
Or - I need to save for another file ex ? ? ?
Do you have an idea what can I do ? ? ?
The code you write down:
<br />
private void document_PrintPage(object sender, <br />
System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
<br />
<br />
string text = "In document_PrintPage method.";<br />
System.Drawing.Font printFont = new System.Drawing.Font<br />
("Arial", 35, System.Drawing.FontStyle.Regular);<br />
<br />
e.Graphics.DrawString(text, printFont, <br />
System.Drawing.Brushes.Black, 10, 10);<br />
}<br />
*************************************************
This code I use with all my poject.
for text,line's,square....
That does not work so good.
|
|
|
|
|
|
Can I insert text\shape in Location X Y in milimetr's ? ? ?
|
|
|
|
|
Read out the documentation you would find everything you want.
The best place for this is MSDN.
Go to microsoft.com and you will find alot.
Mujtaba
|
|
|
|
|
I writ a code that print table + data to the printer.
I have laser printer with 64M memory.
but when I send to the printer about 500 pages I have a Problem.
about 50 pages the spooler of winXP start goes slowly.
what can I do ?
I have The Same code In VB and hi works More Good - but In WIN98.
Can I pass The spooler?
Can I writ The data to file and then send it to print?
can I save the table in "System.Drawing.Printing.PrintPageEventArgs"
and add to this event any time data????
Can I writ In PS???
|
|
|
|
|
HI
i make a search function.and this search function bind with a Thread.
as i click on the search button threat start and searching continu.But
i also put a animation control that animate as searching continue .
But problem is this after complete the search the animation control also moving.And i do't gettting where the thread ends.
How can i stop animation control as search complete
Parshant
|
|
|
|
|
Use one of the many signaling mechanisms possible to notify the other thread of this thread's completion. The simplest way is to use a boolean variable
volatile bool continueAnimation = true;
void AnimationFunc()
{
while (continueAnimation)
{
}
}
void ThreadFunc()
{
continueAnimation = false;
}
|
|
|
|
|
Hey all, I have a few realy importent questions that are pausing my program.
I REALY need some help, pleaseeeeee help!
1. I need to do a program, that when I tell it to, it will restart the program and update from the click-once auto-update.
How is it possible from inner-C# programming? (from inside the program - events)
2. I have an IP of a counter-strike server.
I need to check if the server exists (responding), and if it does, to check if it has password (and if possible to check if the password is correct by what I give it), and the num of ppl playing atm.
These three are for the ones that know how to use a Thresher's SharkBite.IRC library:
3. How can I easly see if a user is in a channel, from a UserInfo sent in a PrivateMessage?
4. How can I check a state (@p, Vo+ced or regular) of a user, from a UserInfo sent in a PublicMessage?
5. How can I change my usermode to +x if I don't have a usermode like that?
If you can provide a snifft of a part of code that would help even more!
Thanks ALOT!
NaNg.
|
|
|
|
|
2. I have an IP of a counter-strike server.
---- and you want to do a counter-strike hacker?
|
|
|
|
|
Not at all. I'm currently building a bot that ppl msg him an ip, and I wanna check if it exists, so they didn't fool it.
|
|
|
|
|
Hi,
I want to draw my own graphs in a WinForm, but I don't want to draw directly on the
Form. Which control is best to draw inside of? Picture Box? Panel? etc...
thanks for help...
|
|
|
|
|
Your best bet is to write your own control which draws it directly. A picture box is only good if you write the code to generate a bitmap with your graph, and use a picture box to display it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|