|
Hi,
I made an eventhandler for handling keys. I no longer handle the . (dot), it drives me crazy.
Thanks for your time and help!
|
|
|
|
|
Yustme wrote: I got an array of 20 textboxes. How can i change this for all the textboxes?
Create a class that dervives from TextBox and do whatever it is you are trying to do in that class. It would be a lot cleaner that way.
|
|
|
|
|
Hi,
Sounds intresting. I never did such thing before.
Do you got a sample about that?
|
|
|
|
|
Hi All,
As i need to pass some values from .net dll to html page. I embedded the .net dll using object tag. As well as i am ablt o pass values from html page to .net dll using PARAM tag. After clicking the button in dll , i want to pass return value to the html page. As i am novice in this, can anyone help me to get resolve the same.
As I need it very urgently, can anyone help me.
Thanks in advance,
Aruna
Aruna
|
|
|
|
|
So I have a text file in my projects resources that I need to read into an array.
It's path is:
global::Project1.Properties.Resources.rar
it returns byte[]
How would I get information from this file?
- Munty
|
|
|
|
|
Hi
try this
using (Stream s = this.GetType().Assembly.GetManifestResourceStream("Project1.Properties.Resources.rar"))
{
// Read the content into byte array.
}
|
|
|
|
|
Hi,
Thanks for replying.
this.GetType().Assembly.GetManifestResourceStream("string") keeps on returning null.
Doesnt matter what I use it with, even files that I successfully use elsewhere will always return a null :/
Here are one of the tests that returned a null:
Object o = this.GetType().Assembly.GetManifestResourceStream("Project1.Properties.Resources._01")
This shouldnt have returned a null because I've used that resource elsewhere for an image.
Here is the code I used that resource for that worked:
imagePanel[0] = Project1.Properties.Resources._01;
- Munty
|
|
|
|
|
hi munty
have you set the build action property of the file to Embedded Resource?
|
|
|
|
|
Tried it as Embedded Resource, Content and None in the Build Action property.
Null on all of them :/
- Munty
|
|
|
|
|
Finally got the damned thing to work.
Turns out I could use this line:
TextReader tr = new StreamReader(GetType().Assembly.GetManifestResourceStream("Project1.Resources.rar.txt"));
After I fiddled with the properties file so that it returned a string instead of a byte array.
Wierdly enough I can still get properties and stuff from the file from:
Project1.Properties.Resources.rar
I just cant do anything like read in from it when using that line.
Well it's finished. Thank god for that.
- Munty
-- modified at 12:46 Friday 17th November, 2006
|
|
|
|
|
Hello All,
i have a property in my DataClass and i bound it to a control
<br />
Binding adminBind = new Binding("Checked", user, "IsAdministrator");<br />
this.chkIsAdmin.DataBindings.Add(adminBind);<br />
this Property throw an Exception when some conditions not meet (this code is inside the set of the Property).
<br />
public bool IsAdministrator<br />
{<br />
get { return Convert.ToBoolean(_Record.WL_ISADMIN.Value); }<br />
set<br />
{<br />
if (value)<br />
{<br />
if (CanBeTheUserAdmin())
{<br />
_Record.WL_ISADMIN.Value = value;<br />
}<br />
else
throw new Exception("Δεν Μπορείτε να κάνετε τον Χρήστη Administrator διότι Υπαρχει ήδη Administrator για το Συνεργείο!!");<br />
}else
_Record.WL_ISADMIN.Value = value;<br />
}<br />
}<br />
right now when the exception is thrown the control just DON'T lose Focus, and the user get confused.
How can i cath the Exception in order to show the Exception Message to the User??
Any Saggestion is most Wellcome!
Nassos
-- modified at 7:41 Thursday 16th November, 2006
GanDad
|
|
|
|
|
From everything I read the compiler doesn't create properties in the IL it creates, it creates a method for setting a value and a method for getting the value. In the java world using accessor methods in the code is the way things are done and it works fine. Apart from the syntax of setting or getting a property value from code, which may be a bit nicer than the method syntax and the fact that people should learn to behave themselves in get{} code (I once worked with someone who changed the selected index of a combo in a VB6 Property Get for a comboBox, great fun when putting watches on things) I can see no advantages in using properties over accessor methods. At the same time I can see problems like the inability of c# to create Property delegates (i'm talking well behaved ways here) encouraging me to use accessor methods.
Can anyone think of reason why I should use properties in my code? Do we just blindly do things this way because we always used them in VB or because the books teach it that way?
Russ
|
|
|
|
|
Hello,
One reason could be the user support over the designer (VisualStudio Designer).
arachnoid wrote: Do we just blindly do things this way because we always used them in VB or because the books teach it that way?
Never worked with VB before, but I'm also a fan of properties.
Martin
|
|
|
|
|
I hadn't thought about that. I guess things like databinding use properties aswell.
Maybe if the compiler allowed you to use either Propertyname = value or set_Propertyname(value). That way the delegate problem would be solved without relying on c#'s underlying implementation and we would have the best of both worlds.
Russ
|
|
|
|
|
Its just eye candy - as you rightly state, under the hood the IL is a get_PropertyName() and set_PropertyName(value) method.
I use properties as I prefer the look of
int myValue = myObject.MyProperty
than
int myValue = myObject.GetMyProperty();
|
|
|
|
|
You don't have to use properties if you prefer not to. Virtually everybody does though, as they make code much easier to understand.
|
|
|
|
|
One small adavantage is you can do something like this:
MyStringProperty += " Concatenate this...";
for getters and setters this would be SetStringProperty(GetStringProperty() + " Concatenate this...");
Same for other type (int, double,...)
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
Hi guys
anyone could help me or give me a hint on How to develope an iPod like menu for a pocket pc program?
thanks
Riazi
|
|
|
|
|
Hello all,
I'm new to DirectShow application. I've build a normal application that can run .avi file. I've got an error in RenderFile(), like problem in file loading. so please anyone can help me out how to solve this problem? File path is correct and to load .jpg file it's working fine but in loading .avi files I got problem.... ...And ya I'm building this application in C# using visual studio 2005.
Please reply soon...
Thanks for reading my question...
alpa shah
|
|
|
|
|
Which version of DirectShow are u using?
Have you referenced the dll in ur app?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
All dll's i've included in that. I'm using platform SDK that is server 2003 sp1. I think it is most recent one for DirectShow application.
alpa shah
|
|
|
|
|
is your hardware accelertion turned on
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
Is it giving any exception?
Which method have u called to play the .avi file?
can u paste some code so we can get to the problem.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
yes, it's throwing me exception.
I've implemented the sample application from this site only...
sample code is:
try{
//get the graph filter ready to render
OpenFileDialog ofg = new OpenFileDialog();
if (ofg.ShowDialog() == DialogResult.OK)
{
String fileName;
fileName = ofg.FileName;
graphBuilder.RenderFile(fileName);
Text = fileName;
//set the trackbar
isSeeking = (graphBuilder.CanSeekForward() == -1) &&
(graphBuilder.CanSeekBackward() == -1);
if (isSeeking)
trackBar1.Enabled = true;
else
trackBar1.Enabled = false;
trackBar1.Minimum = 0;
trackBar1.Maximum = (int)(graphBuilder.Duration * 100.0);
Text = fileName;
//prepare and set the video window
videoWin = graphBuilder as IVideoWindow;
videoWin.Owner = (int)panel1.Handle;
videoWin.WindowStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
Rectangle rc = panel1.ClientRectangle;
videoWin.SetWindowPosition(0, 0, rc.Right, rc.Bottom);
mediaEvt.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0);
//set the different values for controls
trackBar1.Value = 0;
minutes = (int)graphBuilder.Duration / 60;
seconds = (int)graphBuilder.Duration % 60;
statusBar1.Panels[0].Text = "Duration: " + minutes.ToString("D2")
+ ":m" + seconds.ToString("D2") + ":s";
graphState = State.Playing;
//start the playback
mediaCtrl.Run();
}
}
catch( Exception ) { Text = "Error loading file"; }
alpa shah
|
|
|
|
|
What i had done is as follows:
Create a user control.
i have written all the above code in this class.
and then created an object of this usercontrol in another form.
and called the Run method from that form.
it works perfect.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|