|
public can access by all class, internal can access by it's namespace, protected can access by it's inherit class.
How to access a member only by special base class or a class which implement the special interface?
=== Game is power! ===
|
|
|
|
|
Internal code can be accessed only from the same assembly, not namespace.
As far as I know, there's no way to do what you want to. protected is useful if only a derived class can call the method. Otherwise make it public and trust your caller.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Impliment a containment or Nested class or a Has-a relation.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
how do I iterate through each item in the listbox using the foreach command? I can't figure out the variable name or type for each listbox item. do you have any ideas?
Thanks,
Stephen
|
|
|
|
|
foreach(object oLB in listBox1.Items)
Because a listbox can define the value member of any object to display, it contains objects. Use something more specific assuming that you know what's in there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
This[^] was the second match I got from google.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi to all,
i am using this tutorial on CP to notify real-time of events being logged to syslog and am trying to implement it so the icon of the event being logged appears as the icon for the NotifyIconData() struct, but i cannot figure out how to get a handle to the events icon, and google has not helped me either
can anyone please help ?
kind regards,
g00fy
|
|
|
|
|
I am trying to use some VB code in C# and being very new to databases I can't figure out the following.
Private Sub Connect_Click()
Dim con As ADODB.Connection
Dim recordset As ADODB.recordset
Dim constr As String
Set con = New ADODB.Connection
con.Provider = "ADPProv.ADPProv.1"
constr = "host=" & Host.Text
constr = constr & ";product=" & Product.Text
constr = constr & ";server=" & Server.Text
constr = constr & ";pooling=TRUE"
con.Open constr, "", Password.Text
con.Properties("GROUP") = "ADMIN"
Set recordset = con.Execute("Object",,adCmdTableDirect)
Do Until recordset.EOF
With Output
For Each Field In recordset.Fields
.AddItem Field.Name & "=" & recordset(Field.Name)
Next
.AddItem""
End With
Recordset.MoveNext
Loop
End Sub
Private Sub Data1_Validate(Action as Integer, Save As Integer)
End Sub
I am using:
string constr = string.Format("provider=ADPProv.ADPProv.1;host={0};product={1};server={2};password={3};group=ADMIN;polling=TRUE",
tBox_HostInfo.Text,
tBox_ProductInfo.Text,
tBox_ServerInfo.Text,
tBox_PasswordInfo.Text);
OleDbConnection con = new OleDbConnection();
con.ConnectionString = constr;
I don't know how to reproduce this section of VB code:
con.Properties("GROUP") = "ADMIN"
What is this doing?
Thanks
|
|
|
|
|
Is there any way to cause a DataGridView to lose focus? At the moment, the underlying dataset for a cell is not being updated until I lose focus. I either need to cause the data to be changed while still in focus, or cause the dataset to change focus and auto-save the data?
|
|
|
|
|
try giving focus to some other element at the time you want to lose focus from datagrid.
hope this helps....
- ashish
|
|
|
|
|
please send me the code for editing and updating data in a data grid.in C# ASP.net.
I have used the grid properties given in .net
|
|
|
|
|
I know how to read a text file line by line, open up a StreamReader and sr.ReadLine(), etc.
But is there an easy way to move through a string in memory line by line?
I thought i could "foreach" on the strings characters looking for the \n control character, etc. But its hardly as neat as ReadLine().
So is there a pre-build, neat way of reading an inmemory string line by line?
|
|
|
|
|
Yes.
System.IO.StringReader
---
b { font-weight: normal; }
|
|
|
|
|
The same way would work. Whether a file is persisted on disk or in memory it is what it is - that is, all the bytes are read in as-is unless transcoded (converted from one encoding to another) wile being read-in.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
Can anyone explain what I have been experienced here for radio button control?
I dropped three radio button into the form in Windows Application, it will recognize they are in the same group and allow me to check one radio button at a time.
I did the same in the Web application, it will let you check all the radio buttons at the same time.
Also, those nice valisation controls in Web tool box, not in Window at all?
It's bizzare that Microsoft handles their tool in this way.
Thanks
handy
|
|
|
|
|
You can't mix Windows Forms controls and Web Forms controls together like that (although a Winodws Forms control can be embedded into the resultant HTML to be displayed on the client - but not used on the server).
Windows Forms controls are tied to window handles that every control from the desktop and top-level windows to controls like radio buttons. These send messages throughout Windows.
Web Forms controls output HTML to the page to be displayed in the client. They are completely different things.
For Windows Forms, the radio buttons to be checked exlusively as a group must all be in the same container, be that an entire form or a GroupBox .
For Web Forms, the radio buttons must all have the same Name property (which is the name used in the form data).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath! It's been long time! Welcome back!
I've been missing your wisdom in the finer points of Win32!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's been collecting at http://blogs.msdn.com/[^], though that's mostly about Windows Installer issues.
I do have an interop section where I post and explain the things I keep repeating here in order to keep from repeating them here!
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
HI,
i have the following problem.. i have the following string "abcd".
how to assign the "ab" to one string,
and "cd" to the other.
actually my input "ABCD" keep changing.. and they are in HEX.
i wanna assign then to 2 string.. one as the high byte then other as a low byte..
EXAMPLE.
input is HEX "ABCD"
i wanna assign High bit as "AB"
then lower as "CD"
then movw in total=low+high
end result is total = "CDBA"
thnak for your help guys
|
|
|
|
|
You could do a simple loop:
string input = "ABCD";
string output = string.Empty;
for (int i = input.Length - 2; i >= 0; i++)
{
output += input.Substring(i, 2);
} There's lots of ways you can do this, since it's simple string parsing. The fact that the input string is in hexadecimal is moot if you never need to convert it. Now, if you actually wanted to convert it to numbers you could do something like the following:
string input = "ABCD";
int high = int.Parse(input.Substring(0, 2), NumberStyles.AllowHexSpecifier);
int low = int.Parse(input.Substring(2, 2), NumberStyles.AllowHexSpecifier);
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Here's my issue in a nutshell. I have a table that I bind to columns in a DGV, and, in addition, I have one nonbound DataGridViewCheckBoxColumn in the [0] position. In my code, I bind the data, but upon trying to access the checkboxes, I get errors that say the values are null. How do I check the .Checked property of the checkboxes?
//relevant code, cut/pasted so it might be out of order.
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.AutoGenerateColumns = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dgvcbcSelect,
this.dgvtbcName,
this.dgvtbcDescription,
this.AttachmentKey,
this.AttachmentType,
this.AttachmentSourceID,
this.AttachmentID,
this.FileName,
this.FileSize,
this.ContentType});
this.dataGridView1.DataSource = this.attachmentBindingSource;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 25);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(792, 241);
this.dataGridView1.TabIndex = 1;
//
// dgvcbcSelect
//
this.dgvcbcSelect.HeaderText = "Select";
this.dgvcbcSelect.Name = "dgvcbcSelect";
this.dgvcbcSelect.Width = 50;
//
// dgvtbcName
//
this.dgvtbcName.DataPropertyName = "Name";
this.dgvtbcName.HeaderText = "Name";
this.dgvtbcName.Name = "dgvtbcName";
this.dgvtbcName.Width = 150;
//
// dgvtbcDescription
//
this.dgvtbcDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.dgvtbcDescription.DataPropertyName = "Description";
this.dgvtbcDescription.HeaderText = "Description";
this.dgvtbcDescription.Name = "dgvtbcDescription";
// ALL OTHER COLUMNS HAVE .visible=false;
Anyways, when I load the form that has the datagrid, I do this:
{
InitializeComponent();
myAttachmentClient = new AttachmentClient(); //holder for the dataset
myAttachmentClient.LoadAttachmentList(inKey); //loads the data from a SQL server
versionKey = inKey;
dataGridView1.DataSource = myAttachmentClient.AttachmentTable;
}
After this, putting in MessageBox.Show(dataGridView1.Rows[0].Cells[0].Value.ToString()); gives me an error. How can I access the 'checked'-ness of the checkboxes?
|
|
|
|
|
Oohh, found my solution. Its MessageBox.Show(dataGridView1.Rows[0].Cells[0].FormattedValue.ToString()). Fuuuuun.
|
|
|
|
|
The current program I am working on has a lot of user Checkboxs and currently when ever I change a property I end up coding something like this:
CheckBox1->Enabled=true;
CheckBox2->Enabled=true;
...
CheckBox30->Enabled=true;
this is obviously not a very efficient way of doing this... so I'm looking for a more efficient way... maybe something along the lines of
for(int c=0;c!=31;c++)
{
CheckBox(c)->Enabled=true;
}
this code will obviously not work but any suggestions on how to make something like this work??? Cheers*
Debs
|
|
|
|
|
If all of your checkboxes are located in a container control (panel, groupbox) or if they are the only controls on your form then you could use a foreach statement.
foreach(Control aControl in form1.controls)
{
CheckBox aCheckBox = (CheckBox) aControl;
aCheckBox.Enabled = true;
}
I did not test the above code. It's just off the top of my head.
You could also create and arraylist of checkboxes and interate through then the same way.
www.lovethosetrains.com
-- modified at 13:10 Thursday 22nd September, 2005
|
|
|
|