|
Namespaces can span multiple assemblies. If you're trying to access a class the assembly in which it's contained must be referenced by the assembly that needs to use that Type. The namespace may exist in the current assembly or another dependency, but the class exists in the one assembly. Make sure that assembly (not class) is referenced.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
AH.... ya lost me lol. Did I mention I was a huge, HUGE NEWBIE and blonde to boot. What is an assembly? what does this structure look like? And how can I reference an assembly, verses the class?
Judy
|
|
|
|
|
You should read Inside the .NET Framework / Assemblies[^] on MSDN, as well as the rest of the overviews of .NET under .NET Framework[^]. It's important to understand the basic concepts before getting started.
Assemblies contain not only the stuff I mentioned earlier, but all the Types defined in that assembly. A Type is a class, struct, enum, or delegate that is contained in a simple assembly. If you want to reference a Type from one assembly in a different assembly, you must reference that assembly in Visual Studio .NET (or using the /r param for the command-line compiler for the language in which you're developing).
For example, if you want to develop a Windows Forms application, you project must reference the System.Windows.Forms.dll assembly, as well as a few others like System.dll and System.Drawing.dll. If your application references another project (that compiles to an assembly), right-click on References and click Add Reference. Select the Projects tab and add your project (if it's in the same solution, otherwise use the .NET tab for .NET assemblies or the COM tab to add an interop assembly).
The using keyword used to "import" namespaces is only to save you from having to type the full namespace and class name, similar to the import keyword in Java. If you try using using with a namespace that is defined in another assembly (and remember, a namespace can span multiple assemblies so just because the namespace is available doesn't mean the class is available), then you must reference that assembly.
Remember, be sure to read about the .NET Framework and understand the concepts, such as .NET isn't limited to C# and - once compiled - the fact that the source was written in C# makes little to no difference (different languages compilers that target the Common Language Runtime, or the CLR, all produce Intermediate Language, or IL, with only a few differences depending on compiler optimizations and what the compilers supports).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
I am trying to find away to change a DataGrid column value to an image.
Example:
If I have a column called Test and the value of that columns cell is "Y" I want to change "Y" to an image instead of displaying the "Y" value.
Hope someone can help.
Thanks.
Jarrad D. 
|
|
|
|
|
You'll have to extend DataGridColumnStyle and make your own column style. It isn't too hard - especially when you don't have to worry about handling edits. See the DataGridColumnStyle documentation[^] in the .NET Framework SDK for more information, as well as an example that hosts a DateTimePicker control. Instead, you could host a PictureBox control and forget about handling the edit-related methods (unless they're abstract , in which case just don't provide any editing implementation) if you don't want users to be able to select a new image.
There's also an example here, if you like: http://www.codeguru.com/cs_controls/DataGridImages.html[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
I need to launch a Graphic Event (Paint) from a normal Event (Resize). How can I do it??. I'm trying but I can't make a PaintEventArgs from the Resize Event.
Thanks
----
hxxbin
|
|
|
|
|
Call Invalidate() on the Control.
Charlie
if(!curlies){ return; }
|
|
|
|
|
The best way to force a repaint when you resize a Control or Form (which derives form Control ) is to override the Control and in the constructor (or some method that's called in the constructor) call SetStyle(ControlStyles.ResizeRedraw, true) .
At any time, though, you can call Control.Refresh to invalidate the entire control and force a repaint. If you only want to invalidate a certain section, first call Control.Invalidate and optionally pass the region you want to invalidate, then call Control.Update to repaint the invalidated regions. You can always just call Control.Update to repaint any regions that were invalidated by something else (like a form passing over it, in which case a WM_PAINT method is sent by Windows anyway).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is it required to call Control.Update after calling Control.Invalidate ? I doubt. As I remember I would repaint my form just by calling Invalidate() method. Clear me if I am wrong, please!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
No you're not entirely wrong, but if you don't call Control.Update to force it to repaint, your control won't be repainted until the next WM_PAINT message is sent, which you have no control over. Calling Control.Update repaints the invalidated region immediately.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks everyone, I finish my .NET Control =P (My first).
And I used Invalidate(), works fine. And I used SetStyle, with the DobleBuffer to optimize my animations, I wanna write a article with my new animation control, Can i do??
----
hxxbin
|
|
|
|
|
Override ResizeRedraw to return true, paint as normal.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
hi
how can i set the startlocation of an winform?
i don't mean center or standard
i want to let it start bottom right of the screen, over the clock and tray icons
can someone tell me how i can do so
thx
|
|
|
|
|
Maybe you want a NotifyIcon??
----
hxxbin
|
|
|
|
|
hxxbin wrote:
Maybe you want a NotifyIcon??
i have one already
i need exacly what i wrote in the 1st post
|
|
|
|
|
Form.Location and set Startup position to manual.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
leppie's right about the positioning, but I must add that - according to the PSDK documentation - you can't display your form on top of the taskbar unless you use a borderless form and make it the size of the screen (a full-screen window), much like a screensaver.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Like I understand, you wanna a form that appear like the MSN messenger popup, why you don't check the code of one article named TaskbarNotifier here in CodeProject.
The author make a popup form over the taskbar like you need.
----
hxxbin
|
|
|
|
|
Hello everybody,
we are developping an asp.net apps ans we want to send an email, who will set, in outlook, a rendez-vous in the calendar of the user. How can we do this? We are using System.Web.Mail.MailMessage class to send the email.
Thanks for your answer.
Demmo
|
|
|
|
|
You'll need to look at the Office API references on http://msdn.microsoft.com[^] for exact details. You could also have such an email message get generated and open the meeting request in Outlook Express or another simple email reader to examine the content (SMTP headers, MIME headers, etc.). The latter would be reverse engineering so you can't be too sure about cases that aren't accounted for, so be sure to send many requests with different options. The best way, of course, is to find any documentation you can about this email type on MSDN.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
I've got a question regarding the treeview control on a C# windows form. How can I get the text of the selected treeview node? I know I need the .Text property to get the string, I just can't seem to get the selected/active treenode. I want to take part of that text and put it in a tool tip. I've got the tooltip part working but I'm getting the parent tree nodes text. The tree structure looks like this.
Last Name<br />
Smith<br />
Wallace<br />
<br />
First Name<br />
John<br />
William
Thanks

|
|
|
|
|
Manster wrote:
How can I get the text of the selected treeview node?
In away like this:
string str="";
if(treeview.SelectedNode!=null)
str = treeview.SelectedNode.Text
Mazy
No sig. available now.
|
|
|
|
|
Mazdak,
Thanks for your help. I'm actually trying to get the child node from the code you listed above. So if I'm currently getting "Last Name" returned to me now, I'm trying to get "Wallace" instead.
This is the tree structure.
Last Name
Wallace
A child node is selected and I need it's text. Is this possible?
This is the tree structure.
Thanks
|
|
|
|
|
SelectedNode has property named FirstNode which you go through it and get child nodes. It contains child nodes of selected node.
Mazy
No sig. available now.
|
|
|
|
|
Hi, i'm working with a datagrid and I want it to be updatable, but i dont want the last row ( insert row) to be available to the user, how would i proceed?
|
|
|
|