|
That's funny - thinking that someone would actually try searching this forum before posting a question for the "umpteenth" time.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I live in eternal hope.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
HI,
Actually i post this above question yesterday.See my habbit is i won't sit and wait for answer. if i don't know any concept i will post my queary here in codeprooject and simultaniously i will try my leval best to figure it out.
That's why i wrote that " I got answer and not expecting answers....
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
See my habbit is i won't sit and wait for answer. if i don't know any concept i will post my queary here in codeprooject and simultaniously i will try my leval best to figure it out
That is very commendable, however that was not the reason for my post. The reason for my post was that you announced to the world that you knew the answer, but you did not tell the world the answer. You kept the answer to yourself. CodeProject is for sharing information.
It is good manners, if you find the answer to the question you asked, to tell everyone that (1) you found it [which you did] and (2) what the answer is [which you did not].
So, I repeat: What is the answer to your original question?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Who is going to draw ?
Tabcontrol have a properties called DrawMode. This will set or get the value that whether user or system will paint the caption.By default it is normal. Means system(OS) will paint the caption for you. If you(parent form) want to draw the caption you have to set the value of the property to OwnerDrawFixed.
You can mention DrawMode on design time or runtime like below mentioned code.
this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
Now you mention who is going to draw the caption.
Next thing is how is going draw ?
Tab control have an event called DrawItem event which will occure when ever an area need to be painted.
eg:
this.tabControl1.DrawItem += new DrawItemEventHandler(this.tabControl1_DrawItem);
private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
Font f;
Brush backBrush;
Brush foreBrush;
if(e.Index == this.tabControl1.SelectedIndex)
{
f = new Font(e.Font, FontStyle.Bold | FontStyle.Bold);
backBrush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.Blue, Color.Gold, System.Drawing.Drawing2D.LinearGradientMode.Vertical);
foreBrush = Brushes.White;
}
else
{
f = e.Font;
backBrush = new SolidBrush(e.BackColor);
foreBrush = new SolidBrush(e.ForeColor);
}
string tabName = this.tabControl1.TabPages[e.Index].Text;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
e.Graphics.FillRectangle(backBrush, e.Bounds);
Rectangle r = e.Bounds;
r = new Rectangle(r.X, r.Y + 3, r.Width, r.Height - 3);
e.Graphics.DrawString(tabName, f, foreBrush, r, sf);
sf.Dispose();
if(e.Index == this.tabControl1.SelectedIndex)
{
f.Dispose();
backBrush.Dispose();
}
else
{
backBrush.Dispose();
foreBrush.Dispose();
}
}
}
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
hi Colin Angus Mackay ,
I am really sorry for this late posting of my answer. I want this sort of suggections in future also. ;P
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
I have a c# console app that periodically look at one directory to see if any new folders have been uploaded there. If it finds a new folder it should move this folder to a different folder. This works fine my problem is that it moves this folder with the old permissions. Is there any way that I can change the owner of this folder to be set to its new parent folder? I have had a look at activeDs but I just can't seem to delete the existing permissions I can however add new permissions.
Any help would be greatly appreciated.
Thanks in advance.
Gavin Jeffrey
|
|
|
|
|
See http://weblogs.asp.net/cumpsd/archive/2004/02/08/69403.aspx[^] and follow the link to the GotDotNet sample, which is written by Microsoft and will be included (in some form) in the upcoming .NET 2.0 release.
Also keep in mind that you must have (or rather, your application) the right permissions to make changes you requested, otherwise what would be the point of file security?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
great it works. Thanks for the help.
|
|
|
|
|
Hello everyone.
I've been trying to find a way of figuring out how to know which method called another method.
For now I'm using the MethodInfo MethodBase Object and passing it as a parameter to the called method but is there a better way of doing it? I know that you can find out who the calling assembly is, but how do I find out the name of the method that made the call?
Thanks for any help.
|
|
|
|
|
Look at my post regarding exactly how to do this, a few posts down (i think yesterday or the day before), on how to use StackTrace. From there u can get the MethodBase just as you want it, but be warned, it will likely be much slower than passing MethodBase.Current. Anyways, I dont find anything wrong with your approach as long as you keep those ugly ones private!
top secret xacc-ide 0.0.1
|
|
|
|
|
Thanks for your reply, I'll look into your suggestion.
I don't see anything wrong with it either other than I'm lazy and don't want to have to create the methodbase object from each of the methods that calls that particular method, I'd rather have the called method figure it out.
Again, thanks for your help.
|
|
|
|
|
Hi Friends
I have a console application that produce assembly in .EXE. This app has some dependency assemblies which it reference in the project.
Now i want to give my client only the .EXE file. So i want to statically link the dependency assemblies in this .EXE .
The Assembly Linker tool(al.exe) only links the modules or the resource files.
Any pointer and idea is most welcome.
Thanx a lot
Naveen
|
|
|
|
|
Static linking is not supported by the .NET framework. True, you can combined a few assemblies, but its purely a hack, not static linking in the true sense. .NET is designed around dynamic assemblies that are self-describing.
top secret xacc-ide 0.0.1
|
|
|
|
|
hi leppie
Thanx for info.
Yes my main requirement is to combine few assemblies into one main assembly(.EXE) nad just give my client the .EXE file.
If you the solution or any idea ,please do let me know
Thanx a lot
Naveen
|
|
|
|
|
softp_vc wrote:
Yes my main requirement is to combine few assemblies into one main assembly
I am curious. Why? What is wrong with distributing a few assemblies? If this was really an important requirement why didn't you build it as one exe in the first place?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi
you are right at your place.
But right now my concern is to link the dependent assembly into the main assembly file.
Hope any body would be having the idea for this
Regards,
Naveen
|
|
|
|
|
I don't think you understand: it isn't supported. And if you're referring to the .NET base class library assemblies (mscorlib.dll, System.dll, etc.), then I'm guessing you also don't want the client to have the .NET Framework installed, huh? Guess what - that's not possible, either. The .NET Framework is more than just .NET assemblies - it's a complete runtime made up of system components and must be installed.
There is a project somewhere on the web that attempts to circumvent this, but all it really does is collect only the required components of .NET for a particular application and install them locally into a directory. It's still the .NET Framework, just a hack and not installed as system components, thus bloating the system.
Just like Java requires a JVM and VB6 and lower requires a VB VM (virtual machine), .NET requires the CLR.
Colin is right, though: if the dependent assemblies are ones you created, then don't create dependent assemblies and create all the code into one .EXE assembly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi friends
Thanx very much for giving me such a useful info and having a discussion with me.
I look forward for such a discussion in future
Thanx again
Naveen
|
|
|
|
|
IF set the visual style using Application.EnableVisualStyles(),so
the image in ListView can not be displayed. How to display the image
in ListView in XP visual Style?
Colin
|
|
|
|
|
Never seen that! You should call Application.EnableVisualStyles() only once, followed by Application.DoEvents() (this fixes a bug) as the very 1st 2 lines in Main().
top secret xacc-ide 0.0.1
|
|
|
|
|
You are right, Thank you !
|
|
|
|
|
leppie wrote:
You should call Application.EnableVisualStyles() only once, followed by Application.DoEvents() (this fixes a bug) as the very 1st 2 lines in Main().
Where were you when i needed to know that?
I pulled out lot of hair trying to find answer to that, guess that teaches me to try to find you guys as the first resort!
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
In my win app,i embed a webbrowser control axWebBrowser1,after has loaded a page ,no matter what sentence below was executed:
((IHTMLDocument2)axWebBrowser1.Document).designMode="On";
or
((IHTMLDocument2)axWebBrowser1.Document).designMode="Off";
the browser's IHTMLElementCollection.Lenght will became to 0:
HTMLDocument doc=(HTMLDocument)axWebBrowser1.Document;
((IHTMLElementCollection)(((mshtml.HTMLDocumentClass)(doc)).all)).length<--=0
why?
|
|
|
|
|
I need to make a control, I think. All I need is a multi column list, with transparent background, which does not show a scroll bar, instead scrolling in response to function calls. If it could also associate a value with a row, and return that value instead/as well as the displayed data, I'd be in heaven. Know ye of such a beast ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|