|
How's the read/write access to that folder?
|
|
|
|
|
Hi professionals
i want a c# code which allow me to record small sound waves whatever extension from a mic.
thanks so much
bahaa
|
|
|
|
|
Try this...
<br />
Process soundRec = new Process();<br />
soundRec.StartInfo.FileName = "sndrec32.exe";<br />
soundRec.Start();<br />
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
thanks for ur reply but i want to press a button (record) for example so the program start to record and each time i press (record) it saves the wav automatic like 1.wav,2.wav,3.wav etc in a specific location.
thanks for ur time
bahaa
|
|
|
|
|
Ah I see you wanted a customized version of the sound recorder. I think the reply below points to a link that can help you out
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Can this article[^] helps you?
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
Hello, I am just starting out with C# and I need an ideea on how to go ahead with my software. This is not a direct programming question but more like a programming approach.
I am making an application in c# and .net (vs 20008) and my software contains a tab control.
I add tabs in the tab control from 5 buttons (each button adds a different tab). The tabs will contain different forms in it.
Now I store every tab in a list, just so I can delete them with ease.
Now for my dilema. Each of the 5 buttons creates a different object, a different form (a window that contains forms) in the tab.
It's easy to store the tabs in a list becouse they all have the same type. Give me an ideea on how I can store different objects in the tab control (so every tab of the tab control will have a single object).
I need to know what object I have in a tab, so that when I delete the tab, I also delete the object.
I don't know if I explain correctly, but I here is an image below, just so you have a better picture of what I want :
www.sodevrom.net/object1.jpg
So here is what I have got so far :
*************a list that contains the tabs :
public List<control> lTabs=new List<control>();
*************I add the tabs like this : (the text deppends on what button I click on)
lTabs.Add(new TabPage());
lTabs[lTabs.Count - 1].Text = "Button 1";
cTab.Controls.Add(lTabs[lTabs.Count - 1]);
*************I delete the tabs like this :
lTabs[0].Dispose();
So how can I asign some objects so I can do something like this :
lObjs[lObjs.Count - 1]=new Object1 ( or object 2 or object 3 deppending on the button I press)
and
lObjs.destroy();
Thank you in advance
|
|
|
|
|
I'm not sure I understand the problem correctly, but you can always add an arbitrary number of controls to a Control via its Controls collection. In your case it would look like this:
private void button_Click(object sender, EventArgs e)
{
TabPage tabPage = new TabPage(((Button)sender).Text);
Label label = new Label();
label.Text = "Label";
label.Location = new Point(10, 10);
label.Size = new Size(100, 36);
Button button = new Button();
button.Text = "Button";
button.Location = new Point(10, 50);
button.Size = new Size(100, 36);
tabPage.Controls.Add(label);
tabPage.Controls.Add(button);
tabControl1.TabPages.Add(tabPage);
}
There's no need to manually destroy the controls unless they need to be disposed.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
Thank you for the reply but my question is more on how to go on with C#, a technique on how to think.
But anyways, if I add controls in a tab page, and if I delete the tab page, are the controls from the tab page auto deleted ?
And again, let say I want to refer to an object that I added in a tab page, how can I add it so I can keep evidence of where the object is. Let me give you a better example :
Tab Control
->Tab Page1
->object1 (generated from class Object1)
->Tab Page2
->object2 (generated from class Object1)
->Tab Page3
->object3 (generated from class Object2).
How can I store the 3 objects so I can access them with ease. As I sayed, I can access the tab pages very easy :
lTabs[0]
I can't do the save for the objects. I would want to make it like this :
lOBj[0]
I can't do that becouse object1, and 3 (or 2 and 3) are different, and I can't make a list to store objects from different classes, right ?
Did I explain good now ?
|
|
|
|
|
sodevrom wrote:
But anyways, if I add controls in a tab page, and if I delete the tab page, are the controls from the tab page auto deleted ?
Unless the controls contain no unmanaged resources there should be no problems, but I'm not entirely sure myself.
sodevrom wrote:
How can I store the 3 objects so I can access them with ease. As I sayed, I can access the tab pages very easy :
lTabs[0]
I can't do the save for the objects. I would want to make it like this :
lOBj[0]
I can't do that becouse object1, and 3 (or 2 and 3) are different, and I can't make a list to store objects from different classes, right ?
Do you want to store multiple objects per tab page or only one object per tab page?
If it's only one object per tab page, then you can put it into the Tag property of the tab page and access it like that: object obj = lTabs[index].Tag
If you want to store multiple objects per tab page, then you could also store a List<object> into the Tag property. Another solution would be to store this array in a Dictionary<TabPage, List<object>> and access the list ob objects via List<object> objects = dic[TabPage];
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all,
Im having a problem with what should be really easy!! I have BindingList of type MyObject. MyObject has 2 properties, Name and Description...
I can bind the BindingList to a listview no problem using DisplayMember and DataSource. But what i really want is so when I select an item in the listview, i want 2 textboxes to bind to the current item and let me change the value of these 2 items, but as i edit the Name textbox I want it to change the listview??
Is this 2way databinding?
Any ideas on how to acheive this? Im assuming its possible!
|
|
|
|
|
Hi johnson,
what kind of datasource you have? are you filling your listviews, textboxes and other stuff with data from a dtabase right?
I ussualy use comboxes and textboxes, listview i dont use but i think they work the same.
So, you fill you listview with data, right? and you do some editing in the textboxes, right? and you want that changes o appear in the listview i suppose.
Listen johnson, you dont really edit the listview! you edit the database (have to create one if you dont have one)!
1) Fill your listview with data from the database, and bind your texboxes to the listview.
2) When you what to edit listview from the textboxes, you will have to trigger a sql store_procedure (using sql server) that edits a record, after trigger another procedure the refreshs data so new record(or chanded record) appear in your listview.
Again, you edit/delete/add records in a database not in the listview
GoodLuck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi there! thanks for the heads up! ill do a bit of digging in the week and hopefully get this problem sorted!
once again - thanks for your help!
|
|
|
|
|
Hey.
After googling for an adament amount of time, I found that you can't (apparently) apply transparency to a non-client region of a control.
So the alternative is to have the control inherit the BackColor of the parent container.
The problem is, my Parent control has a gradient background that's fully customizable. So I cannot set a specific BackColor for the control to paint.
Each control has the functions DrawToBitmap() which is usable, but i'm really struggling having it apply to my control.
I'm trying to find the specific background that is located at the position of the non-client region for my control, but it's simply not working.
Currently i'm using:
Graphics Root = Parent.CreateGraphics();
Bitmap RootImage = new Bitmap(e.ClipRectangle.Width, e.ClipRectangle.Height);
Parent.DrawToBitmap(
RootImage,
new Rectangle(
this.Left,
this.Top,
e.ClipRectangle.Width + this.Left,
CaptionOffset
));
e.Graphics.DrawImage(RootImage, new Point(-this.Left, -this.Top));
And this code is as close as I could get it to work. The e.ClipRectangle is the Rectangle within the actual control itself (ie, x will simply always be 0). I'm assuming that by passing this.Left into the Rectangle within the DrawToBitmap function will grab the graphics from the left of the parent control, but it's not working. Not only is the Bitmap RootImage smaller than the actual region I want (by about 8px in width), but when I try to paint it to a second control within the parent container, it doesn't draw a background at all.
Here's an image of the problem[^]. The first panel only displays a part of the background, and the second doesn't display any at all.
If anyone can help or provide more information on the DrawToBitmap function, it'd be much appreciated.
Thanks!
|
|
|
|
|
Epoque wrote: Graphics Root = Parent.CreateGraphics();
What the use of that? Normally that method is dodgy in itself, but you call it and then never bother to use it!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I am storing employee object inside a List<employee>. I am sorting the list based on employee Age. To do that I implemented a method from IComparable intereface. But when i debug the _list.Sort() i do notice list items are sorted out.
So my question is who's relocating/reindexing elements inside the list and how is doing?
public int CompareTo(object obj)
{
if (obj is Employee)
{
int ans = Age.CompareTo(((Employee)obj).Age);
return ans;
}
return 0;
}
|
|
|
|
|
netJP12L wrote: So my question is who's relocating/reindexing elements inside the list and how is doing?
By looking at the source of List<T> in .NET Reflector[^], internally Array.Sort is called with the comparer, which in turn does some sort of QuickSort algorithm.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
I would have to see more of your code to tell for sure what goes wrong, but one way your sorting would fail is if the objects in the collection are not Employee instances; the "is Employee" test would fail resulting in a "return 0" which means all objects have the same order precedence. You might consider adding a log statement, a MessageBox or a breakpoint in front of the "return 0" statement.
|
|
|
|
|
if i need to use variable form other class & other file but same namespace & project
how to use that variable?
example:
--file1--
class A
{ public string a = "aaa"; }
--file2--
class B
{ if(a = "aaa") {}}
please hint to me...
thank so much...
|
|
|
|
|
class B
{
public void SomeMethod()
{
if (A.a = "aaa")
{
DoSomeStuff();
}
}
} The A class needs to be public for this to work if the classes have different namespaces.
The A class can also be internal if the namespace of the two classes is the same.
modified on Thursday, November 27, 2008 1:50 PM
|
|
|
|
|
This is so rudimentary that you really need to buy a book and work through it, before you try to write any code that's not a book example.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
You need to create an instance from class A so you can use its public members.
In this case you should write:
public class A
{
public string a = "aaa";
}
public class B
{
A Ainstance = new A();
if(Ainstance.a = "aaa") {}
if (Ainstance.a == "aaa") { ;}
}
If variable a (or any member in your class) is static, you can use it from class B without creating an instance.
Just like:
public class A
{
public static string a = "aaa";
}
class B
{
if(A.a = "aaa") {}
if(A.a == "aaa") { ;}
}
Hope can help
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
modified on Thursday, November 27, 2008 4:22 PM
|
|
|
|
|
your tip can help me
thank so much...
|
|
|
|
|
You're welcome
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
use internal variable to access it from same namespace.
|
|
|
|