|
You can't. That is a .NET 2.0 feature, so you cannot use it from .NET 1.x code.
:josh:
My WPF Blog[^]
|
|
|
|
|
I think you will have to use P/Invoke code to get to the Win32 Beep call.
PInvoke.net[^]
Steve Maier, MCSD MCAD MCTS
|
|
|
|
|
Do it the old-fashioned way:
Console.WriteLine("\a");
Logifusion[^]
|
|
|
|
|
That didn't work for me, in a WinForms app. Does that require some system volume setting to be non-muted?
:josh:
My WPF Blog[^]
|
|
|
|
|
Put it in a console app. It's a standard PC speaker beep, not a windows beep.
Logifusion[^]
|
|
|
|
|
Hi All
when I am trying to discover visual studio 2005, I got a strange behavior when I am trying to put about 50 button on the form and run the application it makes some flicking in the startup
I don't know why?
|
|
|
|
|
This is due to progressive redrawing of parts of a displayed surface. u can use buffering to avoid this flickering.
see Control.DoubleBuffered Property. set this one into true.
|
|
|
|
|
Thx, I tried this , DoubleBuffered is protected property and should be used in the sub class
I made an inherited class from class button and used it in my form instead of class Button
see this
class InheritedButton:Button
{
public InheritedButton()
{
this.DoubleBuffered = true;
}
}
but it is still flickers????
|
|
|
|
|
Use SetStyle(); and set it in the control that the buttons are getting added to. Also, if you are doing the adding of buttons, instead of the designer, then you should do the following:
public void LoadButtons(string[] buttontext)
{
this.SuspendLayout();
...
this.ResumeLayout();
}
-- modified at 10:03 Thursday 13th July, 2006
|
|
|
|
|
i did but still got the problem
public frmMain()
{
InitializeComponent();
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
LoadButtons();
}
private void LoadButtons()
{
panContainer.SuspendLayout();
this.SuspendLayout();
for (int j = 0; j < 50; j++)
{
InheritedButton TempButton = new InheritedButton();
TempButton.Cursor = System.Windows.Forms.Cursors.Hand;
TempButton.Size = CellSize;
TempButton.TabStop = false;
TempButton.Text = "?";
TempButton.UseVisualStyleBackColor = true;
TempButton.Click += new System.EventHandler(this.button_ClickGenralHandler);
//TempButton.Location //Coding For locations
panContainer.Controls.Add(TempButton);
}
panContainer.ResumeLayout(false);
this.ResumeLayout(false);
}
and this the code of the Inhireted Controls
class InheritedButton:Button
{
public InheritedButton()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
}
}
class InheritedPanel : Panel
{
public InheritedPanel()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
}
}
i still got the problem
|
|
|
|
|
IP-GATES OFFERS MCSE CCNA BOOT CAMP TRAINING IN INDIA/GOA
MCSE CCNA CCNP MCSD VB.NET RHCE CHECKPOINT CCSE CCSP
COST EFFECTIVE .A STUDY AND HOLIDAY EXPERIENCE
IP-GATES (IT TRAINING TRUSTED GLOBALLY)
http://www.ipgates.com[^]
IP-GATES (IT TRAINING TRUSTED GLOBALLY)
http://www.ipgates.com
|
|
|
|
|
Too cheap to buy an ad on CodeProject, huh?
What part of "Do not posts ads in the programming forums" do you not understand?
ipgates wrote: IP-GATES (IT TRAINING TRUSTED GLOBALLY)
Except at the CodeProject, and any other site you spammed with this garbage.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Anybody interested in CCNA, CCNP ,CCVP,CCSP,CCIE and CISSP Boot Camp. Please click here to register or to know more.http://www.logicindia.net
|
|
|
|
|
I have a table with one column. This table has more than 1500 rows.
I want to print those 1500 rows of one column using 4 columns in the report(rdlc).
How is it possible?
|
|
|
|
|
Is there a way to get a the name of the logical drive? Not the drive letter, but the name. For example, the drive C: usually appears in under My Computer as "Local Disk ( C: )". How would I obtain the "Local Disk" text?
I love to program!
|
|
|
|
|
Give a try to WMI. There are some CP articles about WMI in C#: start here.
Best,
Jun
|
|
|
|
|
If your using C# 2005, you can get this from the DriveInfo[^] class.
"Local Disk" is the drive Type, and is used only because the drive doesn't have a volume label.
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 14:06 Wednesday 12th July, 2006
|
|
|
|
|
All very good answers, however the codeproject reference gets the drive letter, as does the DriveInfo class for C# 2005. Lets say you plug in an external hard-drive and assign it the drive letter (which is the Name property of the DriveInfo class and the ManagementObject["name"] property for WMI) "V:", and you also name it "External hard-drive". How would I get the "External hard-drive" text?
I love to program!
|
|
|
|
|
That's the VolumeLabel property of the DriveInfo class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am getting an error "Specified cast is not valid at line 20 in the following method and the Sql query is working and i don't know what that is .Please reply with the possible solution. Basically I am tring to get an UserGroupID using the above method .
Here is the Method I am Using :
public Hashtable GetAllUsersAndIDs()<br />
{<br />
SqlConnection dbc = new SqlConnection(Config.ConnectionString); <br />
Hashtable userTable = new Hashtable();<br />
dbc.Open();<br />
try<br />
{ <br />
SqlCommand sqlCommand = new SqlCommand(<br />
"SELECT DISTINCT UserGroupID, Name " +<br />
"FROM UserGroupTable " +<br />
"ORDER BY Name",<br />
dbc);<br />
SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();<br />
long userGroupID;<br />
UGUserNode user;<br />
while (sqlDataReader.Read()) <br />
{<br />
if (!sqlDataReader.IsDBNull(0))<br />
{ <br />
userGroupID = sqlDataReader.GetInt64(1);<br />
if (nodes.ContainsKey(userGroupID))<br />
{<br />
user = (UGUserNode) nodes[userGroupID];<br />
}<br />
else<br />
{<br />
user = new UGUserNode();<br />
user.LoginName = sqlDataReader.GetString(0);<br />
user.ID = sqlDataReader.GetInt64(1);<br />
user.IsActive = true;<br />
nodes.Add(userGroupID, user);<br />
}<br />
userTable.Add(userGroupID,nodes[userGroupID]);<br />
}<br />
}<br />
<br />
sqlDataReader.Close();<br />
}<br />
catch(Exception e)<br />
{ Console.WriteLine(e.Message);}<br />
finally {dbc.Close();}<br />
return userTable;<br />
}
Palestine
|
|
|
|
|
By my calculations, line 20 is:
if (nodes.ContainsKey(userGroupID)) If this isn't the right line, please explicitly indicate it.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Perhaps this line has an error:
user = (UGUserNode) nodes[userGroupID];
try to use the "as" keyword for casting...
user = nodes[userGroupID] as UGUserNode;
then check if your variable user is null, if so it means it's not the same type as your UGUserNode class.
this i think is the safest way of casting if your not sure of the type of the object you want to cast.
hope this helps!
microsoc
|
|
|
|
|
I have two things I wish to accomplish:
1) Based on the current date determine the StartDate of the current Work Week and the End Date of the current Work Week.
2) Based on the current date generate a list of the prior 10 work week ranges and the upcoming 10 work week ranges.
I would like to implement both of these as public methods within a class. My language of choice is C#
Thanks In Advance
Palestine
|
|
|
|
|
TAREQ F ABUZUHRI wrote: I would like to implement
Emphasis on the word I. Is there a problem you're encountering while writing these? A specific question?
Logifusion[^]
|
|
|
|