|
Ok, I made a variable and it always used the default I set to it since I commented out a line for testing. I uncommented have it works. Those are the errors I love!
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Hi all,
i have two classes(one for form that i draw on it,
and other class)
so i want to make invalidate in the first class to draw by
onpaint method in the first class
Generator
|
|
|
|
|
Can't be done. Instead, create a delegate between the classes, so the class that forced invalidation either calls a method that calls invalidate in the second class, or passes it's graphics object to the second class for painting. You can't make the event args in the second class contain the graphics object of the first class.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how can i create like a beep sound, but make it play through the speakers and not the computer's internal speaker? (so, obviously, Console.Beep() is not what i need).
|
|
|
|
|
You can P/Invoke MessageBeep() . The declaration can be found on pinvoke.net, for example.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
But those are just system sounds...how can i create my own sound?
|
|
|
|
|
Ok, if the standard beep isn't good enough for you , you can still use the System.Media.SoundPlayer class.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Again, i don't want to load an external file, i want to CREATE a sound at runtime
|
|
|
|
|
If you said precisely what you want and what you don't want we wouldn't have to guess...
Anyway, in that case you should start reading about the WAV format. Basically you create a buffer for the audio data, write a WAVEFORMAT (look it up in MSDN) to it and add the samples you want to play. That's the most flexible you can get.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
sharpiesharpie wrote: how can i create like a beep sound, but make it play through the speakers and not the computer's internal speaker?
Is this article on a simple beep[^] what you are looking for?
|
|
|
|
|
i have Byte[]
and i want to convert it to image ( using System.Drawing )
how that can be done
thanks
|
|
|
|
|
Just a guess:
using (MemoryStream memoryStream = new MemoryStream(bytearray))
{
Image image = Image.FromStream(memoryStream);
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
it really works... good guess
thanks allot
|
|
|
|
|
Hi,
I go through a collection of toolstripmenuitems and if its the correct item, i set it to be checked.
foreach (ToolStripMenuItem sortItemDropDown in sortItem.DropDownItems)
{
if (sortItemDropDown.Name.Equals(tickSortBy))
{
sortItemDropDown.Checked = true;
}
}
The problem is that the sortedItem.DropDownItems has a Seperator in it, thus i get an exception telling me i cant convert a seperator to a menuitem. Is there a work-around ?
Regards,
Gareth.
|
|
|
|
|
In the foreach loop use the common base type ToolStripItem and only cast to a ToolStripMenuItem if the current item is really a ToolStripMenuItem .
foreach (ToolStripItem sortItemDropDown in sortItem.DropDownItems)
{
if (sortItemDropDown.Name.Equals(tickSortBy) && (sortItemDropDown is ToolStripMenuItem))
{
((ToolStripMenuItem) sortItemDropDown).Checked = true;
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
You can check on the type of the toolstripmenuitem. For the separator this is System.Windows.Forms.ToolStripSeparator.
|
|
|
|
|
I'm not sure about your problem, but may I ask, why not use .NET remoting? Remoting is built atop sockets, yet abstracts away the underlying byte transfers, allowing you to simply call theServer.DoSomething() on the client, or call client.DoSomethingElse() from the server.
|
|
|
|
|
Hi there,
i wonder if there is a way to include the windows-explorer in your own application.
i need the abilty to show some folders with files in my app and it´s quite a lot
of work to do the stuff with the ListView control.
is there any way to include windows explorer in my app? maybe through some kind of
activex?
thanks
jkersch
|
|
|
|
|
C# File Browser[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I am implementing a custom IExtenderProvider derived class so I can dynamically set the following properties on a control:
Required (using an ErrorProvider)
Description (ToolTip)
Errors (using an ErrorProvider)
Caption
I have everything working except for the caption. Ideally, I would like to add a Label control to the form for the given UI element. I know how to draw the label text myself, but that doesn't give me any of the accessability features that I gain when using a label.
The problem I'm running in to is that I can get the label to appear at design time but not at run time. Essentially, when I detect that a new control has been added I try to add a new label control (positioned appropriately) to the parent's Controls array. This works fine at design time but at run time the Parent property of the control I'm extending is null.
I'm trying to do this using an IExtenderProvider so I don't have to create subclassed versions of the UI controls to add a caption. In case you want the background, the project I'm working on needs to allow a dynamically rendered UI based on various pieces of meta data contained in the business object. The business object can be customized by the end-user through an admin interface, so I will never know what fields will be present and what their captions should be until it is time to actually render the screen.
Has anybody done anything similar to this? I've pretty much exhausted the information available on Google, which isn't much beyond creating a simple provider.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Without source, it will be pretty challenging to give you much help. Nonetheless, in reading your post my guess is that you have an obvious problem with the Parent that has nothing to do with IExtenderProvider.
You have to solve the null Parent issue (I assume) to parent your Label. Without a parent, the Label will never be drawn.
So to fix your issue, you need to build a scheme to precipitate parent from a source value somewhere.
|
|
|
|
|
mike montagne wrote: Without source, it will be pretty challenging
I completely agree. Unfortunately I'm not able to post source for this. (I am actually trying to get approval to do this as an article (or at least a simplified version) since there seems to be a need for it.)
Since I posted I stumbled across a partial answer to this problem. I am now able to get the label to persist and generally behave properly with one exception. When I first put the extender on the form and start adding labels, none of them appear on the design surface until I close the form and re-open it. I haven't tracked down the reason for this yet.
The fact that the Parent property is null at runtime is normal as far as I can tell. The other controls and extenders that I looked at also had the same problem. (I'm not 100% sure of this since it has been several days since I looked at that aspect of it, but I'm pretty sure that was the case.)
I hope to get approval to do an article based on this work for at least a LabelProvider type control soon since I am digging semi-deeply in to how the designer works and how to manipulate properties using the design-time services.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Scott Dorman wrote: Since I posted I stumbled across a partial answer to this problem. I am now able to get the label to persist and generally behave properly with one exception. When I first put the extender on the form and start adding labels, none of them appear on the design surface until I close the form and re-open it. I haven't tracked down the reason for this yet.
You probably realize this... but the reason is *always* that your algorithm hasn't triggered drawing yet. It is closing the form and re-viewing/restoring it that triggers an invalidate -- which finally gets your labels to draw.
|
|
|
|
|
mike montagne wrote: You probably realize this... but the reason is *always* that your algorithm hasn't triggered drawing yet. It is closing the form and re-viewing/restoring it that triggers an invalidate -- which finally gets your labels to draw.
Yes, that is the premise I am working under. Currently, I am attempting to resolve this by calling Invalidate myself, on both the label and it's parent control but so far it isn't having an effect.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|