|
Instead of setting the background color to Color.Transparent in the constructor, I tried setting it to Color.FromArgb(0,0,0,0), which I've heard is transparent also (because of the 0 for Alpha). That didn't work either.
When I removed that line from the constructor and put it in a button event handler, after clicking the button, it gave me an ArgumentException, saying, "Control does not support transparent background colors."
I want to have a number of controls at dynamic locations on a panel, and be able to see through one control to another (the "controls" should just be a center dot and a circle inscribed in the control's bounds--hence, I want to be able to see one control's ring through another overlapping control).
Can someone please point me in the right direction? Should I be using a different base class (other than Control)?
I don't want to just paint to the parent panel, I want to actually have controls of some kind on the panel...
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello
I've just done that and it throws an exception:
System.ArgumentException was unhandled
Message="Control does not support transparent background colors."
Regards
|
|
|
|
|
This is pure genius. You need to derive a class from the control type, so you can call SetSTyle ( a protected method ) and set the AllowTransparentBackground style ( or something like that ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'll check that out. Thank you, Nader and Christian!!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I did a little reading. For what I want to do, it won't quite work because MSDN says this:
Note:
If there is another control between the control
and its parent, the current control will not
show the control in the middle.
MSDN says it's because it's not a real transparency... it's the control asking its immediate parent to draw itself onto the control (simulating transparency), but ignoring other possible controls between the control and its parent.
Oh, well. If it weren't for the fact that I need to see through all the controls (not just the panel under one control), it would be fine.
I might just have to draw to the panel after all (instead of adding controls to the myPanel.Controls collection).
Thanks anyway! At least I learned why it was throwing an ArgumentException!
-- modified at 0:56 Thursday 24th August, 2006
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello,
I implemented drag and drop for some of my controls. I did it by having my controls implement IDataObject then using the usual mouse(up,down, move, etc) and drag(drop, leave, etc) events, in other controls/forms to accept the drop.
While the control is being dragged its shown along with the mouse as a small square border with a small + sign next to it (I guess this is default). It looks like the small box is the representation of the control being dragged. I would like to show sometime else as the control is being dragged. I've been looking on MSDN and online and didn't find anything yet (they only talked about how to replace the mouse cursor for the drag operation).
I really would like to avoid creating a form and moving that around with the mouse. Is there some handle to replace the default "object being dragged" state/box with something of my own choice.
Thanks,
Ramanan
"One of the Georges," said Psmith, "I forget which, once said that a
certain number of hours' sleep a day--I cannot recall for the moment how
many--made a man something, which for the time being has slipped my
memory."
|
|
|
|
|
You can replace the cursor with whatever you like, the Bitmap class has a GetHIcon method, or something like that, which converts it to an icon, which can then be passed to the Cursor constructor.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian,
I also found a sample for this same method in Chris Sell's new Windows Forms book in an Appendix last evening.
"One of the Georges," said Psmith, "I forget which, once said that a
certain number of hours' sleep a day--I cannot recall for the moment how
many--made a man something, which for the time being has slipped my
memory."
|
|
|
|
|
I made simple SideBar menu like Outlook has and I want to add design time support inside of VS.Net to drag controls onto it the various menu choices.
Can someone please post a link to an article that has added design time support to a custom user control?
Thanks.
|
|
|
|
|
|
Do you know of a link that is for design time support for a regular windows control?
The methods that are overrided in that ASP.NET example don't seem to have a counterpart from to override for normal winforms programming.
Thanks,
Brad
|
|
|
|
|
I have a source file with bunch of text in it. There is a function there, called GetName("Some name"). I need to scan the file for that function and get all the names it tries to load.
So for example, GetName("Jon") should return "Jon" to me. I need to write a regex for that. The regex needs to be simple and not try to do any sort of validation. So GetName("123 lalala") is ok. I dont need to check if the name is a string and all that. I am just interested in whatever is between the quotations inside the GetName() function. Please help.
|
|
|
|
|
GetName\(\"([^\"]*)
should do it. That says match GetName(", then match everything before the closing quote into a group. I think. expresso is the tool you need to check/work with regex.
-- modified at 18:05 Wednesday 23rd August, 2006
I forgot the last ), but I've tested it now and it works fine as written above.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank you, I tested it in expression, and it works great, but with little problem thoough.
Say I have this text: GetName("Igor")
the expression would return "Igor", which is good
but If I have GetName("Igor", the expression will also return "Igor", eventhough the last bracket is missing. I tried sticking \) in the expression in a couple of places, but produced an erronous expression.
-- modified at 18:50 Wednesday 23rd August, 2006
|
|
|
|
|
\) at the very end will add an ending bracket requirement. I didn't put it because it seemed superfluous
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
oh, that works. True, there is no real need for \) at the end, I will afterall be parsing a C# file, but just to be safe . thank you!
|
|
|
|
|
Nigor wrote: I will afterall be parsing a C# file,
In that case you may need to check for GetName( "Some name").
Paul
|
|
|
|
|
In work place of VB.net if a .vb file is selected (as .cs in VC#), the work place shows 2 lists under .vb & .vb[design] tabs (Class Name list & Method Name list)
a. Let say we have a MAIN.vb and a MAIN.frm that has a START button (sub-list) in it. If we select MAIN in Class Name list, then we will see START component in that list
b. If we select START in the list then in the Method Name list will show a list of methods (ie: Click, TextChanged ...)
* In VC# we can not see the sub-list of (a) & in (b), it only shows whatever we have already used (not showing availbale list)
Anyone know how to view (a) & (b) in VC# as in VB?
Thanks for any help
|
|
|
|
|
Are you talking about intellisense? It works fine for me.
|
|
|
|
|
I created a bound DatagridView and added an unbound DataGridViewComboBoxColumn and for each rows in the datagrid I add items to cell of the unbound column. What I find strange is that I see items count greater than zero and the values are there in each of the cells looking at the datagridview through the debugger but they don't show up for the user. I see the arrow down but no values are shown.
Not sure maybe I forgot some setting for the values to show ?
Confused but hopefull
|
|
|
|
|
i need one easy way to generate random number between two limits...
maybe some like this...
random_number=Random(maxValue,minValue)
can someone advise to me?
thanx for help
and sorry about my bad english
|
|
|
|
|
|
Hello
Use the Random.Next(MinValue, MaxValue) method
Regards
-- modified at 16:04 Wednesday 23rd August, 2006
|
|
|
|
|
May I suggest you read the documentation on the Random[^] class yourself. What you proposed is entirely unnecessary.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Forgot about Next(int32, int32). Still used to the old C++ Rnd.
Thanks for the gentle nudge
Regards
|
|
|
|