|
Hi All,
I'm trying to create a resizable form with a little bit of auto layout.
Basically I have 7 square buttons grouped into a panel. These buttons must never be split up with any auto layout code.
To the right of the buttons I have a trackbar control. I want the trackbar to grow and shrink as the window gets wider/narrower, but, when the shrinkage would result in the trackbar being below a minimum size (in fact, the width of the button containing panel), i want it to drop to below the buttons.
This image shows my controls - here
Can this be easily done with built in winforms stuff? or must I implement it the long way with various resize event handlers and manual repositioning code? I'm hoping to leverage AutoLayoutPanel - because I will have other controls on the form too, eventually.
Thanks
Jon
|
|
|
|
|
Will this[^] article (EZ layout mgr) help?
/ravi
|
|
|
|
|
Check out the FlowLayoutPanel control. It dynamically adjusts the controls within it to fit, and as long as you group things using panels/groupboxes/etc, they'll stay together.
|
|
|
|
|
What's deal with
treeView1.Nodes.Reverse
'System.Windows.Forms.TreeNodeCollection' does not contain a definition for 'Reverse'
What's the trick to reverse enum a treeview?
Thanks
|
|
|
|
|
er, iterate through the collection backwards?
|
|
|
|
|
edboe wrote: er, iterate through the collection backwards?
ER, yes.
|
|
|
|
|
I need to remove nodes that don't hit a search query, and leave the nodes and their parents.
|
|
|
|
|
I am new to c# so please bare with me...and not laugh to hard at my question.
I can't get onto the MSDN site and since my help menu isn't working correctly I figured I would post my question here.
I was trying to see if there was a way to specify the precision while using double.ToString()? I have a double that returns to me a double with 10 digits after the decimal. I would like to just have it return 3 digits after the decimal.
Do I have to manipulate it using the string.Format or is there a way to do it in the ToString()?
Thanks in advance.
|
|
|
|
|
Try double.ToString("F"), which is uses the same format specifiers as String.Format.
[edit]Sorry, I missed the "3 decimal places" bit. As was pointed out, you want to do ToString("F3") instead.[/edit]
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Thanks....i figured it was something simple, I just didn't think to put it in parenthesis <doh>
|
|
|
|
|
|
Use the formatting string "F3" to get three decimals.
The String.Format method uses the same formatting style as the ToString method. String.Format("{0:F3}", f) produces the same result as f.ToString("F3") .
---
b { font-weight: normal; }
|
|
|
|
|
Hello all,
i am new to C# and there is something i can't get to work, so i a requesting your help !
simple code :
namespace ConsoleApplication1
{
class Father
{
public Father()
{
System.Console.WriteLine("Build Father");
}
public void Something()
{
System.Console.WriteLine("Father : Something");
SomethingElse();
}
public void SomethingElse()
{
System.Console.WriteLine("Father : SomethingElse");
}
}
class Son : Father
{
public Son()
{
System.Console.WriteLine("Build Son");
}
public new void SomethingElse()
{
System.Console.WriteLine("Son : SomethingElse");
}
}
class Program
{
static void Main(string[] args)
{
Son s = new Son();
s.Something();
}
}
}
this simple code displays "Father : SomethingElse" at the console.
How to get "Son : SomethingElse" at the console without rewriting Son.Something() ?
Many thanks for your help !
|
|
|
|
|
Just declare SomethingElse as a virtual function in Father and override it in the Son class.
class Father
{
public virtual void Something() {...}
}
class Son : Father
{
public override void Something() {...}
}
|
|
|
|
|
just declare the somethingelse in father as virtual and override it in the son class.
-Prakash
|
|
|
|
|
thank you very much for helping a poor newbie like me !
|
|
|
|
|
|
Hi All
How to copy all the images in a folder to another using C# multithreading.
Please help me on this. This is my first program in C#.
Regards
Suhas
Suhas Kyadiguppi
|
|
|
|
|
In your other thread call File.Copy() . It will copy any files whther images or not.
Regards
|
|
|
|
|
I'm attempting to use DirectShow.NET to play movies on different DVD drives, with the following call:
hr = dvdGraph.RenderDvdVideoVolume( "f:", AMDvdGraphFlags.None, out status );
I have two DVD drives, E: and F:
Regardless of the path that I give RenderDvdVideoVolume , it always plays the movie on the first drive (E) and the flag bDvdVolInvalid is set true.
Anyone have any ideas? I'm using DirectX 9.0c, etc.
The call is basically just an interface call to the SDK, DirectShow.NET isn't injecting any other code. When I looked at some C++ examples:
WCHAR achwFileName[MAX_PATH] ;
LPCWSTR lpszwFileName = NULL ;
if (lstrlen(m_achFileName) > 0)
{
#ifdef UNICODE
lstrcpy(achwFileName, m_achFileName) ;
#else
MultiByteToWideChar(CP_ACP, 0, m_achFileName, -1, achwFileName, MAX_PATH) ;
#endif // UNICODE
lpszwFileName = achwFileName ;
}
AM_DVD_RENDERSTATUS Status ;
DbgLog((LOG_TRACE, 5, TEXT("Calling RenderDvdVideoVolume(<%s>, 0x%lx, 0x%lx)"),
m_achFileName, m_dwRenderFlag, &Status)) ;
HRESULT hr = m_pDvdGB->RenderDvdVideoVolume(lpszwFileName,
m_dwRenderFlag, &Status) ;
it looks like the string needs to be Unicode format, which is what a C# String is. Still, I wonder what requirements the API method actually has that C# isn't meeting.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
I'm sure you've tried:
hr = dvdGraph.RenderDvdVideoVolume(@"f:\\<code>video_ts</code>", AMDvdGraphFlags.None, out status );
See:
Writing a DVD Playback Application in DirectShow[^]
The first parameter is the name of a directory that contains the DVD files. On a DVD disc, these files reside in a directory named VIDEO_TS.
At least it is USUALLY VIDEO_TS. See:
IDvdControl2::SetDVDDirectory[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
EricDV wrote: I'm sure you've tried:
OMG. No I hadn't.
THANK YOU!!!
And thank's for the links. That's the first time I've seen documentation that clearly says what the volume path actually should be.
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Marc Clifton wrote: THANK YOU!!!
My pleasure Marc. It is exciting for a little guy like myself to be able to assist someone of your calibur. This sure is fun.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
EricDV wrote: This sure is fun.
Well, let's see if we can have some more. Now that it plays from the correct DVD drive, have you any experience playing a DVD over a network from a network mapped or shared DVD drive? It sort of works, except that the audio and video appear to be streamed in big chunks, so it's really choppy.
I came across something about DVD's and block streaming being a problem. And there's this software called AnyDVD that seems to address that. More to figure out!
Marc
Thyme In The CountryPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
Marc Clifton wrote: have you any experience playing a DVD over a network from a network mapped or shared DVD drive?
Sorry, can't help on that one.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|