|
Hi,
I wish to disable toggling of check box in checked list box (C#). If my check box is checked user shall not be able to uncheck it and vice versa but text should be allowed to be selected.
In list box i was able to set colours for items but if i set color i am not able to select any of item. I wish to give colors to items in list box but also i should be able to select the items.
Please help if someone knows the solution of above 2 issues.
|
|
|
|
|
Hello,
Ashish_Sood wrote: I wish to disable toggling of check box in checked list box (C#). If my check box is checked user shall not be able to uncheck it and vice versa but text should be allowed to be selected.
It sounds like you don't whant to set "Enabled" to false.
What you can do is handle the "ItemCheck" event and reset the Current value property of ItemCheckEventArgs.
private void checkedListBox1_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
{
e.NewValue = e.CurrentValue;
}
Ashish_Sood wrote: In list box i was able to set colours for items but if i set color i am not able to select any of item. I wish to give colors to items in list box but also i should be able to select the items.
I think you can select, but the color changes if you do so.
Maybe by handling the "SelectedIndexChanged" and reseting the color you can be successfull.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi Experts.
How can i check a condition during the apllication when my application is idle.
Like in vc++ there is a OnIdle() message handler.
Is this like in c#.
Thanks in advance.
|
|
|
|
|
Use the Application.Idle event.
Standards are great! Everybody should have one!
|
|
|
|
|
Hi,
I'm working in a dynamic code generation project. While creating aspx pages, I'm using such code:
string s=<TD><asp:label id=lbl" + ctrlId + ">" + caption.Trim() + " Runat=server</asp:label></TD>" + Environment.NewLine + <br />
"<TD><asp:TextBox id=" + ctrlId + " Runat=server></asp:TextBox></TD>";
But the "Environment.NewLine" doen't seem to function the way it is supposed to, because i don't get output in 2 separate lines. In the output after adding all such html code, I see "\r\n" instead of "Environment.NewLine" and the everything is in the same line in the file.
Could someone point out whats going wrong here.
Regards
|
|
|
|
|
The code is not displayed properly what i copy-pasted. Pls find it below:
<asp:label id="lbl"" +="" ctrlid="" "="">" + caption.Trim() + " Runat=server" + Environment.NewLine +
"<asp:textbox id=" + ctrlId + " runat="server">";
|
|
|
|
|
the HTML i'm trying to paste is not displayed properly here.
|
|
|
|
|
First of all, check 'ignore HTML tags' when posting HTML
second, there is an ASP.NET forum
third, a newline doesn't generate a break in HTML. The <br> tag does. It doesn't need a /, but I would use <br/> to make it XHTML.
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 )
|
|
|
|
|
Christian Graus wrote: First of all, check 'ignore HTML tags' when posting HTML
Thanks, will do that next time
Christian Graus wrote: second, there is an ASP.NET forum
I posted it here coz I was doing this in C#.
Christian Graus wrote: third, a newline doesn't generate a break in HTML.
I am writing the output to a file, so that I can create an aspx file later. Thats why i used NewLine property.
Regards
|
|
|
|
|
blumenhause wrote: I am writing the output to a file, so that I can create an aspx file later. Thats why i used NewLine property.
OK, that will work in your file, but still won't work in HTML. You can use Newline for formatting, but you need the br tag for the browser.
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 )
|
|
|
|
|
|
the form is not active.
when get new message , how to make the form's icon light?
please give me directions, thanks.
|
|
|
|
|
bool bFlag = true;
private void timer1_Tick(object sender, EventArgs e)
{
if (bFlag)
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\FirstIcon.ico");
bFlag = false;
}
else
{
this.Icon = Icon.ExtractAssociatedIcon(@"C:\SecondIcon.ico");
bFlag = true;
}
}
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Maybe my depiction is blurry.
my meaning with the icon is the rectangle that it delegates a form
in the taskbar.
Are you sure the Icon class can make it glitter?
|
|
|
|
|
you have to attach some cool super-blue leds..
life is study!!!
|
|
|
|
|
I'm quite sure there is an easier method; something like this.focus() or this.activate() but it doesn't seem to work...
On the other side this does work. You'll need to allow unsafe code in your project
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHINFO fInfo);
private void timer1_Tick(object sender, EventArgs e)
{
unsafe
{
FLASHINFO fInfo = new FLASHINFO();
fInfo.cbSize = sizeof(FLASHINFO);
fInfo.dwFlags = 2;
fInfo.hwnd = this.Handle;
fInfo.uCount = 2;
fInfo.dwTimeout = 0;
bool result = FlashWindowEx(ref fInfo);
}
}
}
}
public struct FLASHINFO
{
public Int32 cbSize;
public IntPtr hwnd;
public int dwFlags;
public UInt32 uCount;
public int dwTimeout;
}
|
|
|
|
|
please tell me these variable's meaning, "cbSize","dwFlags","uCount"
,"dwTimeout".
Thanks very much.
|
|
|
|
|
cbSize --> just the size of the structure.
uCount --> how many times to flash.
dwTimeout --> the duration between flashes (0 is some kind of default value)
dwFlags --> it has something to do with customizing the parts of the application that flash. Just google for the FLASHINFO structure and you'll find all the possible values
|
|
|
|
|
This plugin article[^] by Redth is a good place to start since it seems to do something like what I need. The only problem I have with it is doesn't clearly explain the ability to communicate information between the host & the plugin. Well at least to me anyway.
So using that code as a base, perhaps someone can help clear this up for me.
Lets add a button to the host. It's job will be to display "Hello world" in the text box located in plugin1.
Lets also add a textbox to the host along with a button in plugin1. The button in plugin1 will display "hello world" in the newly created textbox on the host.
If anyone can figure out how to communicate between the host & plugin using that example I would be most grateful. I'm about running out of hair!!!!
Any other assistance would also be welcomed or references to other documentation. I've searched & searched, but there's not much around that explains what I need to know. All I can find is documentation on creating a plugin and loading it on a host. Nothing exists (that I know of) to demonstrates communication between the two.
THANKS!!!!!!!!!
|
|
|
|
|
I read your thread in the article. There isn't "one way" to do that. As in most designs, and a plug-in design is after all just another design, there are one or more interfaces that both the plug-in and the host know about and those interfaces are how you communicate from one to the other. Of course in .NET we also have delegates and events that can play a role in these interfaces. The bottom line is the developer must define these interfaces to satisfy the requirements of the project and in this case that means you.
led mike
|
|
|
|
|
Thanks for your reply...
I'm not particularly looking for 'one way' of doing it... Any way will be fine
I'm just looking more for direction as to how to go about doing it. The example I sited does achieve this somewhat by allowing 2 of the plugins to send feedback to the host which in turn launches a dialog box with the information sent to it.
What I am needing assistance with is how to get it to post that information to the host's main form (say a text box) rather than an independent dialog box. Further on down in the message section someone had asked something similar. They wanted to put some data sent from the plugin to the status bar. Someone had posted a reply saying they were able to do it and how, but the answer seemed incomplete so I was unable to duplicate it.
I guess my question really is this. I have 3 .cs files (pluginservices.cs which handles communication w/ host & plugin, my mainform.cs & mainform.designer.cs files) All of them belong to the same namespace (we'll call it 'host'). How can I access a button, textbox etc from my pluginservices.cs file. I thought that if I used a fully qualified name I would at least be able to access the object I want. Apparently this is not the case.
Please keep in mind that I am still rather new to C# so if there are any concepts that I may not be aware about that would make this seem trivial please point it out.
Thanks!
|
|
|
|
|
Paul Groetzner wrote: The example I sited does achieve this somewhat
Perhaps the plug-in design in the article is not suited to your requirements.
Paul Groetzner wrote: What I am needing assistance with is how to get it to post that information to the host's main form
Well if my first post didn't help you understand things more clearly I don't think I will be able to help. In my experience text messaging is not a great format for learning about design concepts, in contrast with a live session using white boards etc.
As a closing comment I would say you might be having a forest/tree problem. If you focus on trying to see "how to get object X to access object Y" rather than focusing on learning and understanding design principles and concepts you may always have this problem.
led mike
|
|
|
|
|
dasfasdfas
I love C# very much
|
|
|
|
|
|
Hi
I need to read a file in my PC in chunks,I should be able to read any chunk of file randomly.Is it possible?
Please advise me
Thanks
|
|
|
|