|
The complication with storing the variable name at the time that each of the controls are dynamically created and an image is assigned to each of them is that there would simply be too many variables. What would be really useful is if there would be code such as the following:
string strBackgroundPath = ctrl.BackgroundImage.getPath();
That way I could perform a comparison like so:
if (strBackgroundPath = strNewBackPath)
{
}
...
I do not know which control is being painted at the time it reaches the paint event handler. That is why I would need to be able to retrieve it inside the paint event handler. The only way that I could do it would be to retrieve the path of the ctrl.backgroundimage at that time.
Is there a way to retrieve the background image path as a string from the ctrl.BackgroundImage property?
|
|
|
|
|
are you using custom controls then create path property in them
else create a class for which will store your your control name and path and create a method in it which will take the name of control and return the path
or simply store them in array
as far as i know there is no such direct property in most of the control
however picture box do have image location property but i don't think it will gonna help you
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
Amar:
Yes, I am using a custom control. Perhaps you are right with your suggestion to add a property called path to the control itself which would hold the string value of the path to the background image.
However, it has been some time since I have been exposed to how to extend the properties to a control, and then only in VB. Could you kindly point me toward a C# version of an article for how to extend the property of a control so that when I am in the Paint Event I could do this:
string strBackgroundPath = ctrl.Path;
I would really appreciate a primer on how to extend the properties of a control in C#. Thanks!!!
|
|
|
|
|
simple
string path;
public string Path
{
get { return path; }
set { path = value; }
}
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
Amar:
OK. I did as you had suggested and modifed the control with the extension of the property. At the places where the control is assigned the backgroundimage property, I found the "Path" property as specified. I made the assignment of the backgroundimage value to this new Path property that we added to the customized control.
However, when I attempt to retrieve the value of the path property, it does not show up in the Intellisense drop down list. I should add that the place where I am attempting to retrieve the value from is in a public sealed event handler class. Also, the variables and classes in this sealed class are all implement the static keyword.
The control that is addressed in the Paint event handler of this public sealed event handler class is retrieved utilizing the Control ctrl = ((Control)sender) code, and this ctrl was implemented utilizing the customized control class that was modified to include the Path property. When I remove the "sealed" key word from the event handler class, it still does not show the new Path property.
What are the requirements to enable the Intellisense drop down list to show the property "Path" that we added to the customized control?
New_Phoenix
-- modified at 16:26 Friday 10th November, 2006
|
|
|
|
|
i never had such problem try rebuilding solution
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
I am facing issue that my code executes fine in english environment but not in German and Dutch envionment. I am adding a method in thread pool to run it in async way then I redirect to some other web page. Here what happens in non english env. parent thread terminate before calling async method. Any idea???
Rajeev
|
|
|
|
|
You can make the parent thread wait for the thread pool's thread by calling EndInvoke on the delegate instance. Something like
delegate void SomeDelegate();
void SomeMethod()
{
SomeDelegate d = new SomeDelegate(AsyncMethod);
IAsyncResult result = d.BeginInvoke(null,...);
d.EndInvoke(result);
}
|
|
|
|
|
Any particular error message? Have you stepped through the debugger to see where it stops exactly?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How can I detect the sound device?
Which "namespace" is required?
and what type is its input and output? is it binary?
Thank you too much.
Bahman
|
|
|
|
|
You'll probably need to go through WMI if you want to enumerate the sound devices. After that I don't know and don't have the time at the moment to look into it.
|
|
|
|
|
Don't know if WMI will be of any help, but in general there are no built-in classes for this in the framework.
You could look into managed DirectX or use p/invoke to call the waveIn* , waveOut* and mixer* functions from winmm.dll.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi all dear friends,
I'm looking for how to auto complete login and password field of any win application.
Anyone have idea ?
Thanks in advance...
|
|
|
|
|
Yes, don't do it. Creating this will bypass the basic security of the application.
|
|
|
|
|
Hi Edboe.
Your idea produce high sucurity risk, but yo can use the property AutoCompleteSource.
Tip: Use the auto complete only for the username.
SINCERELY.
ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|
That's also a security risk. If you use autocomplete, you can see EVERY valid ID in your company, which gives a hacker more information that they could ever imagine. Simply don't do it.
|
|
|
|
|
If I want to design an XML editor that has following limited functionalities:
1. Edit XML using tree view and by writing XML code.
2. Validate XML to given XSD or DTD schema.
3. Check Well-formdness of XML Document.
4. View XML similiar to IE browser.
What should i use? A plugin like MSXML parser that has extended abilities to parse XML or it is easy to write code using System.xml ??
please guide me.
Thank you.
|
|
|
|
|
It seems fairly simple, and would be a great exercise to learn XML programming.
|
|
|
|
|
Is there something you've found lacking in the capabilities of System.Xml? There's an MvpXml library you can check out that has a bit more functionality. I've never seen a need for it though, System.Xml has always had enough power to do what I want.
Logifusion[^] "This isn't a business. I've always thought of it as a source of cheap labor. Like a family."
|
|
|
|
|
|
|
Thank you for link. It is exteremly useful.
|
|
|
|
|
Hi,
I have created an application where I can write to a particular cell in an excel spreadsheet.
How can I loop through each row of the excelsheet so that I can place the database row data into each row of the sheet?
something like:
foreach excelsheetRow (i)
//i represents the row number
cell(Ai).value = DataRow(i).column(i);
cell(Bi).value = DataRow(i).column(i+1);
cell(Ci).value = DataRow(i).column(i+2);
...
Thanks
|
|
|
|
|
I think I worked it out.
// loop through 10 rows of the spreadsheet and place each row in the list view
for (int i = 4; i <= 10; i++)
{
Excel.Range range = excelWs.get_Range("A" + i.ToString(), "J" + i.ToString());
range.Cells.Value2 = "value" + i;
}
|
|
|
|
|
I'm trying to find a code idea on how to drag a file into an application and will produce an output of a different data in a different file name.
I have established the coding for data interpretation algorithm and output file generation. I would like to know how to write a code that I could drag a file with raw data into an application (which rests on the desktop), processes the data, and produce output file with interpreted data into the same directory as the original raw file. I don't want to open the application then use FileOpenDialog to select the files.
I've seen most of the info I found online are the ones that you would have to open the application and you can drag and drop onto the form. This is what I do not want.
Can anyone help?
~ Ron Boucher
|
|
|
|