|
You can position your controls in the designer! however the positioning property should be set accordingly!
Gautham
|
|
|
|
|
You can position the controls of a user control in the designer for the user control. If you then put the user control on a form you can only positition the whole user control as one, and not any idividual buttons that happen to be on it.
|
|
|
|
|
Changing the modifiers of the inner controls from a default 'private' to 'public' may serve ur purpose.
Regards,
KKrista
|
|
|
|
|
That would be unwise. It would break encapsualation. The better approach would be to have a set of methods that control access to just the things you want something outside to be able to manipulate.
|
|
|
|
|
it's not possible u can do that through coding.. but it's not possible at design (atleast according to my knowledge)
|
|
|
|
|
Strange subject; this has nothing to do with inheritance. You don't inherit a class when you create an instance of it.
It might be possible to build something that might enable you to redesign elements in the control in the designer, by exposing the location of the control as a property, and write code to handle the changes at design time. If it's even possible, it's probably far more work that it's worth.
I would suggest that you create a property in the user control that decides the location of the button. Like a ButtonLocation property that takes an enum value that represents the location.
---
single minded; short sighted; long gone;
|
|
|
|
|
I want to have a textbox in which the user can enter only nos. In vb.net we can match the pattern by using the like operator followe by the preferences (e.keyChar Like "[0-9.]"). But how can i do it in C#
Plz give me a hint.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
You can use a maskedtextbox, or use regex, or use char.IsDigit, etc, in a key pressed event handler.
e.KeyCar LIKE "[0-9.]" is doing a regex pattern match, which is wasteful compared to char.IsDigit, but with different syntax, it works fine in C#.
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 about using RegularExpressionValidator control of C#?
-- modified at 4:25 Tuesday 5th June, 2007
Regards,
Murali
|
|
|
|
|
That does something entirely different, a regular expression validator tells you if your input was formatted correctly. He wants the control to not allow invalid input.
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 )
|
|
|
|
|
I have to allow only the nos so I tried by checking the keyvalue so it is checking fine but it should not be allowed to be in the textbox know but whenever i am setting e.keyvalue=0, it is giving that it is a read only property, so plz give me a hint how to disable the invalid characters and to allow only nos and .(dot).
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
if (!char.IsDigit(e.KeyChar) && e.KeyChar != '.')
{
e.Handled = true;
}
Something like that. setting handled to true stops the base class from handling the key press ( so it is then ignored )
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 )
|
|
|
|
|
Thank you so much it is working well and good.
Once again Thank you
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
When we implement the dispose pattern, in protected virtual void Dispose(bool disposing), we need to say if disposing is true, then dispose managed resources as below:
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing)
{
}
}
disposed = true;
}
When we make a call explicitly to this method with disposing = true, in public void Dispose() as below:
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
the managed resources will be explicitly disposed. But why do we need to dispose managed resources explicitly in protected virtual void Dispose(bool disposing). Won't they be disposed automatically by the GC finally after the object reach the end of its life?
Secondly, since those are managed resources, how can we get our own hands on to release them? For example, if we allocate some chuncks of memory on heap (i.e, instantiate classes), is there a way for us to release them explicitly? (Setting the references to nothing doesn't mean that, it just tells .Net that we don't need them any more, they can be recollected from this point of time. And this is actually unnecessary. Right?)
Thanx a lot.
-- modified at 20:00 Tuesday 5th June, 2007
|
|
|
|
|
Because you have no idea when the GC will be called, and the Dispose pattern is used to free unmanaged resources like bitmaps or database connections, so you can count on them becoming available right away.
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 )
|
|
|
|
|
cateyes_99 wrote: Setting the references to nothing doesn't mean that, it just tells .Net that we don't need them any more, they can be recollected from this point of time.
But what about other managed objects that wrap unmanaged resources. Things like File, Pen etc.? For example :-
class TheDisposable : IDisposable
{
IntPtr handle;
FileStream stream;
public void Dispose
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
stream.Dispose();
}
CloseHandle(handle);
}
~TheDisposable() { Dispose(false); }
}
If you don't explicitly dispose the stream here, you'd have to wait for the finalizer for that particular FileStream object to run (assuming it has a finalizer).
Like you said, there is no need (usually) to set references to null in Dispose, as the GC is intelligent enough to figure out that an object has no live references.
|
|
|
|
|
Thanks. It makes much clear
|
|
|
|
|
hi..
in a class method like example : methodname(work obj) i pass the parameter of work object.
in that method i want to use the properties of message class like this
sms.ud = work.msg.Content
suggest me the best way so that i can proceed
|
|
|
|
|
What's the issue exactly ?
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 )
|
|
|
|
|
English please
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
i've created thumnail of picture from a folder
i wanna know the name of the picture that i've clicked on
then i added an EventHandler to each pic but when i used a ImageLocation they don't return anything
so please help
public void pb_Click(object sender, EventArgs e)
{
if (pbSel != null)
pbSel.BorderStyle = BorderStyle.None;
PictureBox pb = (PictureBox)sender;
pb.BorderStyle = BorderStyle.FixedSingle;
pbSel = pb;
string test ="test";
com_image.Text = pb.ImageLocation+"test";
}
thanks
|
|
|
|
|
An image does not store it's path internally.
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 )
|
|
|
|
|
Hi,
PictureBox.ImageLocation will be set automatically only by PictureBox.Load(URL).
When you load the image and calculate the thumbnail you could store the filename
yourself in PictureBox.ImageLocation; then you can retrieve it afterwards...
|
|
|
|
|
I am having 4 panels in my windows form. In that at a time only one panel has to visible and others has to be hidden. I tried it by setting the visibility as true for one panel and false to others but while debugging the visibility is not setting to true and i tried by callinf bringtofront method that time also what i have set in the design time is coming but others are not coming to the front WHY?
Can anyone answer me plz?
note: in the design time all my panels visibility is set to true
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
M. J. Jaya Chitra wrote: I tried it by setting the visibility as true for one panel and false to others but while debugging the visibility is not setting to true
Well, that just plain can't be. Unless some of your panels are sitting inside some of the others ? Then disabling an outer panel will disable the inner one.
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 )
|
|
|
|