|
It seems to me that the new picture box is added on top of the existing one with exactly the same size each time. That's why I only see one image.
Setting the sizemode to autosize doesn't change the size of the picture box??
|
|
|
|
|
Hello
If I were you I'd use a foreach loop to check the parent.Controls for the next:
1- Make sure that the pictureboxes are all added up tto the parent successfully
2- Make sure of the ImageLocation property of each Picturebox
3- The size and location of each picturebox
This may clarify the problem. If it's like you said, simply calculate the size manually each time by calculating the image's size -ie. don't rely on AutoSize"
Happy programming;)
|
|
|
|
|
hi
i want to save avi file on hdd with encryption.then load it to my app as stream and decrypt it and play .how to do that ??
avi file --> encryption --> save on hdd or cd --> load to memory as stream --> decrypt --> play
|
|
|
|
|
I'm reading a book on "Prefactoring" and the author suggest converting primitive types to classes such as:
CommonString State;
CommonString ZipCode;
You can't assign these without the 'new' keyword in C# though, right?
So my idea was to create the types and load their verifying Regex's from a Xml file.
|
|
|
|
|
Seems a strange move to me. For me, state and zip code are easily represented by string. And creating a wrapper for a primitive type is useless as at some point you will need to interact with the primitive type (in some manner).
Classes can't be created without use the new keyword. (Although you can do with reflection)
-- modified at 16:22 Sunday 25th June, 2006
|
|
|
|
|
I read your question and here are some of my thoughts from the top of my head...
I think what you suggest would be a really good approach if you anticipate having a lot of validation and stuff going on.
>You can't assign these without the 'new' keyword in C# though, right?
That's right however you can hide the 'new' call inside an static public method in
the class that you want to create. This is part of the approach when implementing the singleton pattern in C#.
If you like you can add static methods that create your information classes if you think it is ugly with the 'new' keyword. By using this approach you can be more precise about how the object is initialized than if you use oveloaded constructors (where you would have to look up the parameters for the constructor).
For instance
StateInfo stateInfo = StateInfo.LoadFromXml("state.xml");
might be better than
StateInfo stateInfo = new StateInfo("state.xml");
By using a class for each type of information you can also make use of an refactoring called the "Null Object". This means that instead of initializing your StateInfo members to null, you set them to StateInfo.Empty. Now any checks for null is unneccessary and you can implement default values for when the info is missing. For instance the ToString metod return "<no state="" info="" entered="">" or something. This can lead to simpler and more readable code.
If you want to Load any validation RegEx or something for the class you could do that in a static constructor. A static constructor is called once (and only once) when the class is accessed the first time (even if it is through static functions).
Some sample (pseudo-)code:
class StateInfo
{
string m_StateName;
public static StateInfo Empty = new StateInfo("<no state="" entered="">");
public static StateInfo LoadFromXml(string xmlFileName)
{
StateInfo stateInfo = new StateInfo("");
//Init the stateInfo from file...
return stateInfo;
}
public StateInfo(string stateName)
{
//Do instance initialization here
m_StateName = stateName;
}
public static StateInfo()
{
//Called once
//Do class initalization here
}
public override string ToString()
{
return m_StateName;
}
}
So go ahead and use a storage class for your different types of information. I would however recommend that you don't "over design" your system to begin with. Instead go with a light design and refactor it as you go along.
Just some advice as requested, I hope it makes sense!
Have fun!
/Richard
|
|
|
|
|
Thank you very much for the replies.
|
|
|
|
|
it be possible to copy the songs off the iPod ?????????????????????
ahmed elshafee
|
|
|
|
|
ya, it is possible.
try connecting the USB and perform normal USB operation. by USB operation I mean. file transfer thru C# or I/O operations using C#. this requires USB and IPod drivers to be installed. as you connect the IPod operates as a drive.
|
|
|
|
|
hi there.
I was wondering if there is a way (other then looping tru all controls on a window) to get a control by its name.
for example if my window contains txtName (textbox) I would like to get the control by 'txtName'
Thanks :->
|
|
|
|
|
How about this?:
this.Controls["txtName"];
|
|
|
|
|
i want to use Status Bur how and want to change the text dynamicly.plz help.
|
|
|
|
|
Just set the Text property of your status bar.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
|
Hello,
I'm wondering if I can hide it when there's no big contents that require a scrollbar.
Is that possible?
Thanks.
|
|
|
|
|
Can't you control this with attributes on the body element? For example:
<html>
<head>
<title>Test</title>
</head>
<body SCROLL="auto">
...<put content here>...
</body>
</html>
Steve
|
|
|
|
|
That is controlled by the overflow setting of the body tag. The possible values are visible , scroll , hidden or auto .
However, in IE 6 the default value is a special value that is neither of those. The special value has the effect that the vertical scrollbar is always visible.
Set the overflow in your css to auto to get rid of the scrollbar:
body {<br />
overflow: auto;<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
|
Hello,
Can you please tell me how can I disable the ability to selecting text from my WebBrowser control and drop it in another application? I don't want to disable the control!
Thanks.
|
|
|
|
|
The web browser calls the GetHostInfo method from the IDocHostUIHandler interface to get settings which control this. Specifically the DOCHOSTUIFLAG_DIALOG flag. I'm a C++ programmer so I'm not sure how you go about this in C#; perhaps it wraps the details with some fancy new gizmo I'm not aware of.
Googling for "DOCHOSTUIFLAG_DIALOG C#" got me some hits.
Steve
|
|
|
|
|
i want to request a web page with some parameter from a c#.net win app. plz help me.
|
|
|
|
|
hi
System.Diagnostics.Process.Start("iexplore.exe", "http://www.yahoo.com")
Tamimi - Code
|
|
|
|
|
but i only want to pass some param get a response.
thanks for replay.
|
|
|
|
|
what is the web site that you want to request !!
it is your own ?? if yes do the changes(actions that you want to do)
on the web page that you are requesting according to the parameters
Tamimi - Code
|
|
|
|
|
i only request a page with like this url :-
"www.mysite.com?id=mdn&name=kala"
thanks.
|
|
|
|