|
What is your label sitting on?
You could grab the backcolor of that control and set your label's backcolor to the same value ...
|
|
|
|
|
Label is placed on a picture box. I didn't get you. Can you explain how to do that. Thanks.
|
|
|
|
|
Well now, I should have asked that question first ...
Go here[^] scroll to the bottom, there's a posting about creating a transparent label ... the syntax is in VB, but it's all .NET ...
|
|
|
|
|
Making a BackColor Transparent doesn't make your control transparent. It's a lousy name to use because people just assume that it makes the control, well, transparent. It does NOT do this!! Making your label transparent doesn't show you every behind the label.
What it does is make the label take on the background properties of the parent form it's hosted on. The label will show you the background as it is on the parent form, regardless of what controls are behind the label!
In your example, if you set the form's BackColor property to Red and put a Yellow PictureBox on the form, then add a Label control to the form, directly over the PictureBox, the label will show up as Red, not Yellow!
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
How does an application kill itself and restart itself? I have no idea how this is done. Do you fire off some messages to the OS, like "Close" and "Run"?
Marc
Thyme In The CountryInteracxPeople 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
|
|
|
|
|
Thought:
Creates a process to an external program, passing a handle to itself. That program, in turn, sits, waiting for that process to terminate, and then once terminated, attempts to restart it?
|
|
|
|
|
I am guessing you want to do something where you have an update to a windows application, so you need to stop the windows application and then restart it. I think the clickonce deployment for .net 2.0 does a pretty good job with some of these issues. If that is not an option then I think you might have to go with something like have a little exe that you distribute with your windows app. This little app would be called when the windows app closes itself to load the new exe. All the app would need to do is copy out the new code and the start the exe with something like Process.Start("exename");
Hope that helps.
Ben
|
|
|
|
|
hi guys,
i hav created an windows forms application using c# 2.0 using visual studio 2005.but the problem is when i click my controlbox in the top corner in the application it does hide the form but it doesnt exit the application...i can see the application running in the task manager?? is there any options to solve this issue..
I WANT MY APPLICATION TO EXIT ON CLICKING THE CONTROL BOX(X) IN THE FORM
aneef
|
|
|
|
|
Have you coded a Form Closing event handler? If so, what's in it?
|
|
|
|
|
well i didnt code FormClosing event..but now i tried that but still same?? why is that ?
here is the formclosing code i did now
private void frmMain_FormClosing(Object sender, FormClosingEventArgs e) {<br />
Application.ExitThread();<br />
Application.Exit();<br />
<br />
}
any solutions please
aneef
|
|
|
|
|
Well, the default behavior for that control box, is to close the form, so you must have code somewhere that's preventing this from happening.
What's in the Program.cs ? Do you have anything following the Application.Run() ?
You're best bet is going to be to step through your code in the debugger and find out where your form is being hidden and why your application is not terminating.
|
|
|
|
|
Is is possible to create a user interface control in C# .NET 2002 or 2003 that can be used by a Visual Studio 6.0 C++ dialog. I must substitute old J++ ActiveX user interface controls and rewrite then in C#. I have been doing research and have seen that it is possible to access .NET managed assemblies from unmanaged COM components, but these technical articles don't appear to address my problem. Is there some way I can convert a .NET control to an ActiveX component so that it will be accepted by the Visual Studio 6 C++ dialog builder? Any help, tips, assistance will be greatly appreaciated.
Steve J B
|
|
|
|
|
Hi,
I'm building a MDI application which will have a project enviorment.
I have never built such kind of complex application.
I have several datastructures which i need to store in order to keep a state.
I would like to ask how should i record all this into a file.
Thx,
Nuno
|
|
|
|
|
Well now, that's up to you. You could:
- Serialize the data to an Xml file(s)
- Store it in a database (e.g., SQLite, Firebird, MySQL, MSDE, etc...)
- Save it off in your own structured file
There is no 'one way' that is set in stone, and each has it's own pros/cons.
These are all design decisions that you need to make yourself.
|
|
|
|
|
Yes, of course.
But tell me, assuming that i want to use the saving to file in a own structure.
How should i save several types of classes in a unified way? Do you understand my question?
Example.
I have Lists, variables, etc.
How should i do it?
The only time i done that was some years ago in C, using a fwrite to store many strucutres of determined type.
How should i do it here?
Thx,
Nuno
|
|
|
|
|
Have a look at the System.IO classes for StreamReader, StreamWriter, etc...
MSDN Link[^]
|
|
|
|
|
Hi,
It was missing the allow drop property set to true in the target control.
Thx,
Nuno
|
|
|
|
|
Post in wrong thread!
Sorry
Nuno
|
|
|
|
|
Hi,
I'm trying to implemenent some drag and drop functionality.
Basicly i have two controls:
- A listbox, the source of drag
- A tabcontrol, the destiny of drag
Well, i have wrote the following events:
<br />
void layoutPanelOnMouseDown(object sender, MouseEventArgs me)<br />
{<br />
Layout temp = null;<br />
ListBox lb = (ListBox)sender;<br />
int index = lb.IndexFromPoint(me.X, me.Y);<br />
if (index >= 0)<br />
{<br />
lb.DoDragDrop((string) lb.Items[index], DragDropEffects.Copy);<br />
}<br />
}<br />
<br />
void displayEditorOnDragEnter(object sender, DragEventArgs de)<br />
{<br />
if (de.Data.GetDataPresent(DataFormats.Text))<br />
{<br />
de.Effect = DragDropEffects.Copy;<br />
}<br />
else<br />
{<br />
de.Effect = DragDropEffects.None;<br />
}<br />
<br />
}<br />
<br />
void displayEditorOnDragDrop(object sender, DragEventArgs de)<br />
{<br />
string layoutName = (string)de.Data.GetData(DataFormats.Text);<br />
}<br />
I have 3 tabs in the tabcontrol and i want to apply this to the first tab.
When i try to do something with this, i can drag, but i cant drop.
This is in a MDI application where the listbox is in the main form and the tabcontrol is in the child form.
Any tips?
Thx,
Nuno
|
|
|
|
|
|
Hi,
It was missing the allow drop property set to true in the target control.
But now i have another problem:
I want to pass thru the drag and drop a class made by me.
As i can see the allowed formats for drag and drop have a specific set of types.
What type should i use to pass a custom class?
My other option is pass text and then get it based on the text, but using that form i then need to access the MDI parent to have access to the structure that holds the item i need.
Any tips?
Thx,
Nuno
|
|
|
|
|
Hi,
i have a unicode string in arabic language. i want to convert it to its integer value. but when i use Convert.Int32(unicodestring). it raises exception that the input is in invalid format. please guide me how to convert unicode string to int.
Regards,
Omar Lodhi
|
|
|
|
|
Posting the relevant code sample would be helpful. Also, you can try Int32.Parse().
Cheers,
Vikram.
The cold will freeze our stares
We won't care...
|
|
|
|
|
How many characters in the string? Maybe thats the problem?
Perhaps you need to ittereate through each character of the string in turn, something like:
foreach( char character in unicodeString )
{
int charValue = Convert.ToInt32( character );
}
Just an idea.
If your still stuck, you should post some of your code.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Hi,
i have to convert a unicode string to its hex equilent. i have converted this from a VB6 code that uses AscW() method to convert unicode to a integer value and then to Hex value.
Here is code
String strSrc="جمل هندسة في الدنيا أن تبني جسرا من الأمل على بحر من اليأس..";
strResult = "";
for (int i = 0; i < strSrc.Length; i++)
{
try
{
//tried this one get exception
//nVal = Int32.Parse(strSrc.Substring(i, 4));
//tried also statement below also get exception
nVal = Convert.ToInt32(strSrc.Substring(i, 4));
strHex = Convert.ToString(nVal, 16);
strResult += strHex;
}
catch (FormatException e)
{
;
}
}
Exceptoin error string is "Input was not in correct format"
Thanks and Regards,
Omar
|
|
|
|