|
Shock The Dark Mage wrote:
Thanks leppie. Now it's work. Your code need another thing. You need to declare a delegate because Invoke method require a delegate.
A delegate purely a pointer to a method.
Shock The Dark Mage wrote:
AeruIRC.MainForm.AddingChannelTab addingchannel = new AeruIRC.MainForm.AddingChannelTab(m_parent.AddTabPage2);
That is not correct! You will be creatign a new form every time! You should be doing a cast instead.
Cheers
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
leppie wrote:
WHy WHy Why? Why are you doing it this way when all you need to do is invoke it!
Because I haven't known this method. It requires less coding and it's more legible.
Note that if you check the call stack you'll see that the Framework does the same work I described. So my method is not suitable here but it explains how the Invoke function works.
43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
|
|
|
|
|
|
I want my menu item to be highlighted when the mouse cursor moves over it (just like in visual studio.NET's IDE). I believe this can be done by putting all the drawing code in the DrawItem() function. Then depending on which state the MenuItem is in, I draw the appropriate graphics.
I think the DrawItemState.Hotlight state is the one that deals with mouse hovers. But when I tried checking to see if my MenuItem state is Hotlight, it always returns false. The code inside that IF statement never gets executed I dont know why. Can someone please help me? Thanks, and here's the code:
private void menuItem1_DrawItem(object sender, DrawItemEventArgs e)
{
int x = e.Bounds.X, y = e.Bounds.Y, h = e.Bounds.Height, w = e.Bounds.Width;
if (e.State == DrawItemState.HotLight)
{
e.Graphics.FillRectangle(Brushes.Orange, x, y, w, h);
e.Graphics.DrawRectangle(Pens.Black, x, y, w, h);
}
e.Graphics.DrawString("Description", Font, Brushes.Black, x, y);
}
|
|
|
|
|
Why I'm getting this error for main.resx and about.resx:
Resource transformation for file 'main.resx' failed. Invalid ResX input.
Below is the about.cs code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Change_Management_System
{
///
/// Summary description for frmRequest.
///
public class frmAbout : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnClose;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public frmAbout()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmAbout));
this.btnClose = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(328, 264);
this.btnClose.Name = "btnClose";
this.btnClose.TabIndex = 0;
this.btnClose.Text = "OK";
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// frmAbout
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(426, 304);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.btnClose});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmAbout";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "About..";
this.ResumeLayout(false);
}
#endregion
private void btnClose_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
Jassim Rahma
|
|
|
|
|
Well, a ResX error seems that compiling the resx into a resources file fails. From your code I assume that you have only one item in the resx file, the icon for your dialog.
From time to time I encounter icons which do not follow the ico format. So may be this is here the case? If yes then trying another icon would help.
Hmm, did you already try the Resource"Editor" available in the samples of .Net? At least in debugging mode it will give you more hints.
Hope this helps in any way.
Bye
Matze
|
|
|
|
|
I need to create a customized form just like the one
available in Microsoft Access to allow the user to design
his own form style from a fix list of fields with only
textBoxes, date pickers and comboBoxes?
How can I do that? any one tried it?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
How can I display the default Microsoft Windows about box
[attached] within my application?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
how can I check if and mdb password is password protected
or not? I need to write a code to check if the the mdb
file was not password, then setup a password for it.
Jassim Rahma
|
|
|
|
|
Can any one explain how can create a DLL library [in a
design time] which will contains audio or video file, then
write a code to read and play that file [in run-time] on a
windows form?
Please note that I don't want to extract the file from the
DLL library every time user wants to play it to avoid
having a copy of the original audio/video file on the
local machine if the application was aborted.
Thanks in advance......
Jassim Rahma
|
|
|
|
|
I really think you should slowdown a bit and try focusing on one particular problem at a time
jrahma wrote:
Can any one explain how can create a DLL library [in a
design time] which will contains audio or video file
I know of no way, unless add it as a resource maybe...but you will still have to read it to memory and play it from there. Sounds dangerous!
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET low popularity, please visit
|
|
|
|
|
Yes, The only reason to compile it into a library is to keep my rights on the original files, then how you want me to to do this risky stuff??
Jassim Rahma
|
|
|
|
|
Make no mistake - if you distribute a media file and people want to extract it, the only way to stop them is to make sure they can never watch it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
When ???? Run it anywhere?
|
|
|
|
|
The CLI has been released for Mac OS X. Qestion is when will Mac die so we won't need to worry about them.
|
|
|
|
|
what about Linux ?
and how can i get this CLI for MAC OS X???
no any change will run well in these OS?
|
|
|
|
|
danielprc wrote:
how can i get this CLI for MAC OS X???
I'm under the impression that OS X is FreeBSD and this is supported by Microsoft, via Mono, I think.
Cheers,
Simon
"From now on, if rogue states want to buy weapons of mass destruction, they're going to have to go on eBay," Mr. Bezos said.
|
|
|
|
|
|
Michael P Butler wrote:
You won't be running anything complicated anytime soon
The only part missing from SSCLI is GUI support and MS specifics. It will take a bit more work, but there's no reason it cant be complicated.
The whole reason why they are sopprting FreeBSD is (I think) because Hotmail runs on it
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET low popularity, please visit
|
|
|
|
|
The GNU group is developing the CLR for Linux. It is being supported and published with support of another group whose name I cannot remember at this time. (I am not a big follower of Linux stuff) It was originally Project Mole. Start with whatever website the GNU group normally publishes and you may find reference to the project from there. They have a significant amount of the framework built, but it may be a while before you have full functionality.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
I want to make a new NetworkStream class that has a few functions to help make it easier to use. Something like this:
// A helper class to allow us to easily write strings
public class JNetworkStream : NetworkStream
{
public void Write(byte[] Buff)
{
Write(Buff, 0, Buff.Length);
}
public void Write(string S)
{
Byte[] Buff = Encoding.ASCII.GetBytes(S);
Write(Buff, 0, Buff.Length);
}
// Constructor
public JNetworkStream(Socket S) : base(S) {}
// How do you make a copy constructor that makes a JNetworkStream
// from a NetworkStream?
}
The problem is that I have an already created NetworkStream handed to me by TcpClient.GetStream(). Is there an easy way I can convert the NetworkStream to a JNetworkStream?
Thanks,
Jeremy
|
|
|
|
|
From the sounds of what you're trying to do, there are a couple solutions. Your exact goal would determine which is easier to implement.
1) Don't inherit from NetworkStream. Instead, create an object that holds a reference to your NetworkStream object, passing the appropriate calls along to that object.
2) Inherit from it, and do something like this in your constructor:
public JNetworkStream(NetworkStream stream)
{
this.Whatever = stream.Whatever;
this.Something = stream.Something;
}
3) Combine #1 and #2 into a workable solution that takes the benefits of each idea and puts them to work for you in the most effective way.
John :D
|
|
|
|
|
I try add the file IconResources.resources in my program, and i get this error:
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "IconResources.resources" was correctly embedded or linked into assembly "TestDevelop".
baseName: IconResources locationInfo: <null> resource file name: IconResources.resources assembly: TestDevelop, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=null
Anybody can help me
|
|
|
|
|
heldaio wrote:
Anybody can help me
Yes, read James T. Johnson's article: Understanding Embedded Resources in Visual Studio .NET[^]
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
I'm having a bit of trouble with SLEEPing a thread in c#.
I have the following enum used to control how long the thread should sleep:
public enum RefreshRate{<br />
fast = 100, <br />
medium = 500,<br />
slow = 1000<br />
}
but the line:
oThread.Sleep(RefreshRate);
Generates the following error:
Argument '1': cannot convert from 'RefreshRate' to 'int'
The default type for an enum is INT, so I'm not sure what's causing the problem.
Anyone have any ideas?
TIA.
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|