|
If it is the case of Windows application, I think you should use Visual Studio 2005 Express which is built for Faremework 2.0. Visual C# Express is free to download from msdn.microsoft.com and You can convert your existing VS 2003 project to VS 2005 Project easily from that New IDE. To me, the new 2005 Express IDE is really great and way more comfortable.
EMRAN
-- modified at 17:04 Thursday 9th February, 2006
|
|
|
|
|
This was answered earlier today, here[^].
|
|
|
|
|
Hello,
I've posted this question on MSDN forums, but since I'm lost here, I decided to ask here too. I'm sorry for that.
Here's the problem,
I have a custom TreeView with custom nodes as private nested classes in the TreeView.
The TreeView initialize and add some nodes at construction.
Because my classes are quite long, I'll post only a sample to reproduce the problem.
MyTreeView class:
public partial class MyTreeView : TreeView<br />
{<br />
public MyTreeView()<br />
{<br />
InitializeComponent();<br />
<br />
Nodes.Add(new MyTreeNode());<br />
}<br />
<br />
private class MyTreeNode : TreeNode<br />
{<br />
public MyTreeNode() :<br />
base("MyNode")<br />
{<br />
}<br />
}<br />
}
Each time I use this class in a form at design time, the treeview shows with the added custom nodes, but in the form's InitializeComponent(), I get this:
WindowsApplication2.MyTreeView.MyTreeNode myTreeNode1 = new System.Windows.Forms.TreeNode("MyNode");<br />
this.myTreeView1 = new WindowsApplication2.MyTreeView();
Now this won't compile because the node is private to MyTreeView.
Is there any way to prevent the nodes from showing up at design time?
Or am I doing something wrong?
Thanks!
-- modified at 16:19 Thursday 9th February, 2006
|
|
|
|
|
Make MyTreeNode protected public. How else must someone use it? Another option is to create some factory, but the designer will probably break then, then you would have to look at doing your own designer, and by that time I would just not bother... :p
|
|
|
|
|
Thanks for your reply leppie!
I'm afraid it won't work...
The thing is, no one will have to work with the nested nodes except MyTreeView class.
Even if you declare the nodes public, it won't work because when I use the TreeView in an editor, it will try to create the nodes for me. And there's no conversion from TreeNode to MyTreeNode.
So the line that appears on the form's editor (where I use the control) won't compile:
WindowsApplication2.MyTreeView.MyTreeNode myTreeNode1 = new System.Windows.Forms.TreeNode("MyNode");
Now this could be easly solved if I knew how to tell "Don't run this while in design time". Since I don't need it at all at design.
Thanks!
|
|
|
|
|
A good guy on microsoft newsgroups gave me the awnser!
So, for the records, the solution is hide the Nodes property of the TreeView class and apply these attributes:
[Browsable(false)]<br />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]<br />
public new TreeNodeCollection Nodes<br />
{<br />
get<br />
{<br />
return base.Nodes;<br />
}<br />
}
Now the custom nodes won't show on designer.
|
|
|
|
|
hello, i'm working on a project where i need make use of a customised (non-rectangular) window form, and i'm having trouble pinning a menu bar to it. my menubar is displayed a few milicentimetres above the windows form leaving a gap between itself and the form eventhough it is attatched to it. i.e. moves, minimizes and closes with the form. can anyone help me out on how to get this done? the way it should be on a proper windows form..... thanks alot......
dlinks
|
|
|
|
|
Hello,
I am using .NET 2.0, and I have a string "4.0000". I want to convert that string to int, and I am using: Convert.ToInt32("4.0000").
Problem is, that gives me an error, while in the previos version of .NET environment everything was fine. Any ideas?
Thank you.
|
|
|
|
|
Why not just do Convert.ToInt32("4")?
Andy
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
I am pulling the data from the server.
|
|
|
|
|
Try converting to a double or float, then cast it to an integer.
|
|
|
|
|
Don't use Convert.ToInt32 use Int32.TryParse() instead.
|
|
|
|
|
Hi,
In my winform, I have a blocked call to dll that takes a while to return.
I wanted to show to the user a progress bar like to indicate that some process is going on behind and they should wait until its finished.
So, I added an aminated gif image to indicate the progress. But the animation won't happen when the call is blocked and until it returns. This is because its on the same thread.
I know threading will solve my problem, but I dont want to put the blocking code inside another thread since it involves lot of UI updates. Is there any way to put the animated gif inside another thread and make it to animate while the dll code is executed, or alltogether different solution to make this thing work.
Thanks in advance.
|
|
|
|
|
No, there isn't. If you put the blocking call on the UI thread AT ALL, no UI updates will happen until that call returns. You're only choice is to put the long workload in it's own seperate thread and rewrite it so it doesn't do ANY UI updates. It can, however, be written to fire off events that the UI thread can subscribe to.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how can i open gif files?
|
|
|
|
|
How can I (using a windows form application) upload and download MS Word documents into sql server? I have been able to do this without a problem in ASP.net pages, but I can't figure out how to do this using Winforms. Basically, I have been able to read a byte array containing the data into a memorystream object, but I can't figure out how to get the data from that stream object into the word document itself.
Can anyone provide any information or reference articles regarding this topic, please?
Thanks
|
|
|
|
|
What's the problem? Take your byte stream and save it to a file on disk, VOILA, you've got a Word document.
|
|
|
|
|
Thank alot for the response.
I was actually trying to insert this data into a document while in memory and then display it to the user. The primary thing that I'm really trying to avoid is having to worry about file and folder permissions issues which normally happen when trying to write directly to a user's machine. Is it possible to use this stream and somehow display the Save File As dialog so that the user can save the files themselves (while forcing them to save it as a .doc file)?
Thanks again.
|
|
|
|
|
It isn't possible to open a Word document from an in-memory stream, I'm reasonably certain. The problem is that all windows programs deal with files in the form of file paths; if you don't have a file path, you don't have a file.
The only remotely possible way I see is to write some Windows shell extension that makes your stream of bytes look like something available on the file system, giving it some path that isn't necessarily on disk, but still exists nonetheless. But that may be overkill for you.
I'd recommend just writing the file to the user's temporary directory. If you're executing a program, you can write to certain directories even if you're a limited user or running from a limited security context. For example, limited users can write data to this folder:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Or, if you're running in a limited security context, you should be able to use the System.IO.IsolatedStorage APIs to store data (however, launching a file on disk requires disk-access priviledges, which may not be granted to you if you're, say, running your app over the internet via ClickOnce).
|
|
|
|
|
Jonesjo wrote: Is it possible to use this stream and somehow display the Save File As dialog so that the user can save the files themselves (while forcing them to save it as a .doc file)?
Sure. Use a FileDialog , this will return a string with the path and filename the user wants to save the file to. You can then use a StreamWriter(path) to save the file.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you both, Judah and Greeg. I used a combination of both of your ideas (using the FileDialog/StreamWriter and streaming to a file on the user's disk which appears to work pretty well since the app will be able to run in the identity of the user). Everything looks like it's working great.
Thank you both. Your answers were really helpful.
|
|
|
|
|
By the way...Soloflexx = Jonesjo.
My browser logged me in automatically with the wrong profile.
Thanks again,
Jonesjo
|
|
|
|
|
actually i want to compare the date in database with date now...so, how can i do it? if somebody know, help me plz...
jema
|
|
|
|
|
|
I'm constantly receiving this "Old format or invalid type library" error when trying to work with an Excel.ApplicationClass object using System.Runtime.InteropServices. I made all the settings using DCOMCNFG and REGEDIT. I checked the regional language settings for my computer and for Office (they are both en-US now). What does LCID (locale identifier) exactly mean and where should I use it to get my app errors free?
wladutti_cellular_daemon
|
|
|
|