|
I hope I got everything!
Here is what I would do:
//Create an additional boolean Property "BlockMute" in your class "YoureUserControlClass"
public bool BlockMute
{
get
{
return _blockmute;
}
set
{
if(value!=_blockmute)
{
_blockmute = value;
}
}
}
public bool Mute
{
get
{
return _mute;
}
set
{
if(value!=_mute)
{
if(Blockmute== false)
{
_mute = value;
}
}
}
}
//SoloHandler
{
YoureUserControlClass actc = sender as YoureUserControlClass;
foreach(object o in this.Controls)
{
if(o is YoureUserControlClass)
{
YoureUserControlClass c = o as YoureUserControlClass;
if(actc.Solo == true)
{
if(o != sender)
{
c.Enabled = false;
c.Solo = false;
c.BlockMute =true;
}
else
{
c.Enabled = true;
c.BlockMute = false;
}
}
else
{
c.Enabled = false;
c.BlockMute = false;
}
}
}
}
All the best,
Martin
-- modified at 15:59 Wednesday 28th June, 2006
|
|
|
|
|
I'm trying to find a way to grab a given rows cell information, for now just the primary key, and store it in a variable to use somewhere else. If I use listbox's I can simply use .selectedValue() and it gives me exactly what I need, but in this case, I'm needing to do it with a datagridview and this attribute doesn't exist. Thanks!
|
|
|
|
|
PyroManiak wrote: I'm trying to find a way to grab a given rows cell information, for now just the primary key, and store it in a variable to use somewhere else.
If your DataGridView is populated through a DataSource, then the following code snippet might help you.
stringVariable = dataGridView.Rows[index].Cells[index].Value.toString();
Here index could be an integer value or variable holding a value: and is zero (0) based. Alternatively you can use Column name as Cells index, like:
stringVariable = dataGridView.Rows[index].Cells["ColumnName"].Value.toString();
Also you can get the value from the selected or Current row, like this:
stringVariable = dataGridView.CurrentRow.Cells[index].Value.toString();
Using the same technique you cann't get value from an unbound datagridview
Hope this would solve your problem.
Best of Luck.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
stringVariable = dataGridView.CurrentRow.Cells[index].Value.toString();
That worked for my purposes just great!
Thanks a bunch!
|
|
|
|
|
Hey, I need a regular expression that matchs to the following elements:
* the input string must have # in the start of it.
* the input string needs to be longer than 1.
eg.: #b <- ok; # <- not ok; b <- not ok; ## <- ok...
I just don't know how to use Regular expressions...
So thanks alot ^^.
NaNg.
|
|
|
|
|
This one works for me:
^\#[^\r\n]+.*
I had to add the [^\r\n]+ , because Expresso matches some character that simply wasn't after the dash, even when I appended a $ at the end
Or, without Regex:
string foo = "#asdf";
if(foo.StartsWith("#") && foo.Length>1)
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
@"^#.+"
... works for me (in code ... I don't know about Expresso). Remember, "*" specifies zero or more. The "." should not match \r\n unless you are using the RegexOptions.Singleline modifer.
- Bitwise
|
|
|
|
|
Hi there!
I have an application with 2 projects.
First project, I have a mdi form which is a Windows application i.e. I can't use it as a reference. This mdi form is the only item in my 1st project. In my mdi form I have a status bar.
Second project, this is a class library with Windows form, how do I access the status bar in my mdi form from my Windows form when I can't reference it?
Please help
sasa
|
|
|
|
|
You don't. Whatever your writing that is trying to update the statusbar should, instead, be exposing an event that the MDI form can subscribe to. That event should send the message as a String, or whatever else you want really, and the subscriber, namely the MDI Form, should update it's own status bar.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello i need to convert a control.CreateGraphics() for my app. VS2005 gave me a runtime error saying that it's not supported for Compact framework.
Is there anyway to bypass that?
Donkaiser
|
|
|
|
|
Oh I want to create graphics components on a panel.
Donkaiser
|
|
|
|
|
As far as I can see you should be able to create a Graphics object using the Handle of the control.
---
b { font-weight: normal; }
|
|
|
|
|
Unfortunatelly you can't.. When you make something like this :
Graphics g = Graphics.FromHdc(panel1.Handle);
It throws an exception "ArgumentException - Value does not fall within the expected range". And that's all. I have the same problem like donkaiser. I'd like to draw something on a tabControl or a panel and I don't know how.
|
|
|
|
|
I used the paint event of the tab. but my problem is that i need to update the drawing color according to my input data. how to raise the paint event again is still a mystery. I bypassed the problem with panel.invalidate() but now i have flickering problems.
Donkaiser
|
|
|
|
|
Invalidating the control is the proper way of making it redraw itself.
---
b { font-weight: normal; }
|
|
|
|
|
I try to implement double buffer but i can't get the handle of the SetStyle method
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
VS2005 give me the error saying that SetStyle and ControlStyles is not contained in the definition of the form.
how can i get the handle on this function to use on a panel to prevent flickering?
Donkaiser
|
|
|
|
|
Hi all,
Using Serial Port class in .net 2.0 i can able to connect with RS-232 only. is ther any API or way to communicate with RS-422 port...
Thanks and Regards,
Srini
|
|
|
|
|
Have you tried just using the Serial Port control to open the RS422 port.
It might work but maybe I'm thinking of RS485.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi Srini,
The SerialPort class in .NET 2.0 can only be used with COM ports. If your RS-422 controller uses "COM#" names and can be used with the normal Win32 API calls that you use on a COM port (GetCommState, PurgeComm, etc.), then you might be able to use it. Otherwise you'll just have to write your own wrapper around the RS-422 controller's API.
Hope this helps!
Erik
|
|
|
|
|
Hello,
I wondering how it's possible to unzip a file using C#. Simple unzip. Is it possible without third party components?
|
|
|
|
|
Natively... I don't know... But you can allway use SharpZipLib
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
I like use SharpZipLib[^] too. (clickity provided for your enjoyment)
Steve Maier, MCSD MCAD
|
|
|
|
|
Thanks but is there a .NET 2.0 version?
|
|
|
|
|
As other people have said there is a compression namespace and classes in .NET 2.0 now. But have you tried to download and compile the SharpZipLib with 2.0?
Steve Maier, MCSD MCAD
|
|
|
|
|
What platform are you using? 2.0 has compression built in.
|
|
|
|