|
Hi all,
I want to add search Panel to 5 Forms in my C# Application..But I can not declare search panels one by one and coded to every forms..it is wasting my time.
Can I use User Control and decalre search panel in there and added to every Forms?
Or is there good way to do that?
please reply me soon..
thanks in advance..
|
|
|
|
|
The easiest way is to create one base form, add the panel to that form. All the 5 forms should then inherit from the base form.
60% of statistics are made up on the spot
|
|
|
|
|
Make a user control (search panel) and make a MyForm class which inherits Form. Then add the user control to the MyForm.
When u need a Form with a search panel, just make add a new Form class and substitute the Form inheritance with MyForm.
public class SearchForm1 : MyForm
{
}
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
|
|
|
|
|
Thanks for reply..All the procedures are working.
|
|
|
|
|
Hi All
I have a windows service with 2 service classes.. and in the OnStart()method of both classes i am doing a event log to check if both are started.. When i install the service and run it by clicking on it..It Shows message from the first Service Class.. I dont know what to do..Please Help
Regards
RameeDev
public CFirst()
{
InitializeComponent();
if(!EventLog.SourceExists("CFirstLog"))
{
EventLog.CreateEventSource("CFirstLog","CFirstLog");
}
evLog = new EventLog("CFirstLog");
evLog.Source = "CFirstLog";
}
static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new CFirst(),new CSecond()};
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}
protected override void OnStart(string[] args)
{
evLog.WriteEntry("CFirst Started");
}
I am doing the same in CSecond Class
rameedev
|
|
|
|
|
I am writing a C# program which will store the date of installation of the program on user machine along with the Disk Volume ID in an encrypted form, for trial period authentication. This information is generated by the program at the time of the first run. The problem is where to store this information on the user machine so that the user (including the administrator) cannot delete the same. Because if the user could find out where the information is stored (in a file or otherwise), he can simply delete the same and install the program again, which would re-initialize the date of installation. This will defeat the purpose.
So, some cross-check is required to be built so that if the user deletes this file or information, still on re-installation of the program, the cross-check can give the "true" information to the program about the installation date.
Any suggestions or ideas as to where this "cross-check" could be stored in a "safe" manner?
|
|
|
|
|
I would do it by installing a second copy of the same key somewhere else, so that if the first one is deleted, the second one can be checked. If you can encode this info into a file that you write to the hard drive, and call something.dll, or some other obsfucated name, that would be perfect.
No protection is fool proof, though.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thanks for your suggestion.
|
|
|
|
|
When typing text into arich text box and I hit enter no new line is created. Is there a property to change to allow the user to create as many new lines as they would like?
thanks
|
|
|
|
|
Yes, there is a MultiLine property, which you have to assign True.
Happy Coding!!!
|
|
|
|
|
Thanks Ali. I have set that property to true and it is still the same.
|
|
|
|
|
Please re-check your code.
The multiline property is the only one responsible for this effect and is set to true by default, so Ali's reply is absolutely correct.
Are you handling any key events yourself?
Regards,
mav
|
|
|
|
|
hi
i want to create new folder in my website programmaticaly.
how i can do it?
tanks
|
|
|
|
|
Same way you'd create a folder anywhere, the only issue is making sure you have the permission to do so, as the user you're logged in as within the site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
With the standard treeview when a user right clicks a node to show a context menu the selected item does not change. I want to force this change. Is it possible and if so how?
Thanks for any help.
|
|
|
|
|
If there's an event you can catch for the right click, then a tree view has a method for finding the item under the mouse ( assuming it's not passed into the event handler ) and you can select it there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You can subscribe to the MouseDown event and use the following piece of code.
if (e.Button == MouseButtons.Right)
{
TreeNode node = treeView.GetNodeAt(e.X, e.Y);
if (node != null)
treeView.SelectedNode = node;
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I came up with what I think is a good idea for making multithreading programming easier in any .NET language. .NET 2.0 adds the capability to write anonymous functions, it would be nice if there was a "parallel" statement, that could simplify writing threadprocs
<br />
public void DoSomeParallelStuff() {<br />
parallel<br />
{<br />
{<br />
}<br />
{<br />
}<br />
{<br />
}<br />
}<br />
<br />
}<br />
behind the scenes the compiler could create the anonymous functions, add them to the ThreadPool by calling ThreadPool.QueueUserWorkItem. in some cases it would be nice to automatically block the caller thread, maybe a sister statement "parallel-blocked"
<br />
parrallel-blocked {<br />
{<br />
StreamReader rd = new StreamReader("C:\test.txt");<br />
...<br />
}<br />
{<br />
StreamReader rd = new StreamReader("D:\test.txt");<br />
...<br />
}<br />
}<br />
<br />
Console.WriteLine("Tasks complete");<br />
I think this would make it much easier to write multithread capable code. I've actually added this feature to a compiler I'm working on and it works quite nicely.
60% of statistics are made up on the spot
|
|
|
|
|
That would definitely be drool-worthy. Send a proposal to Microsoft and maybe it will see fruitation!
|
|
|
|
|
I would like to read some articles for beginners concerning the creation and use of dll. Can you give me some sites?
|
|
|
|
|
|
how can I find out the volume name of a CD (or another drive) ?
|
|
|
|
|
You'll need to P/Invoke GetVolumeInformation
Have a look at this article[^],
|
|
|
|
|
|
I have a custom control which inherits from Windows.Forms.Label - it adds some field and properties which enable the user to draw a color border around it. In the OnDraw method i first call base.OnPaint, and then draw the border. It has a disadvantage - some text may become covered by the border. Is there a way to avoid this? I can draw the text myself in a smaller rectangle than the client rectangle, but then I loose the control's ability to dynamically wrap the text. Help me!
|
|
|
|