|
Freaky. Just as a matter of course...are you sure you clicked the OK button? It is, after all, late...right? (Not here. It's only 3:30 PM)
But that's wierd. 'Cause I've written the same code before and it's always worked for me.
[edit]Actually, I just did: fileList.Items.AddRange(fileDialog.FileNames); [/edit]
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
I figured it out... It was about 12:30 am when I posted my question and I will use the lateness of that as an excuse The answer? I have my listbox contained by a panel... The panel was expanded the entire top of the app (eg. under the title bar) so guess what when I set the docking on the listbox to fill... Yep it cut off the top line of my files... Do I ever feel dumb now
|
|
|
|
|
djkno3 wrote:
Do I ever feel dumb now
Don't. We all suffer from this type of stuff.
BTW, welcome to CP.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
I want to ignore the mouse click event means whenever the event fired it just get ignored (nothing happen). For example I have a TextBox but when I click on it nothing happen, it just ignores the click event. I don't want to use the Enabled property cause it changes its apperance.
Thanks in advance.
|
|
|
|
|
Just don't write a method that fires when it's clicked...
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Usually in a case like this I reate a new class derived fromm the control that I wasnt to modify, then basically override those event methods. Might be the long way to do it....
Mark
|
|
|
|
|
Hi!
I don't know if this really is a good idea. Because you user expects a visual feedback. If you disable the listbox, let it look disabled and don't fool your user.
But if you want to do it, do the following:
1)Derive a class from TextBox
2)Override WndProc. And call the base-class method on all messages except WM_CLICK. This should work.
Cheers
HTH
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
I agree what u said and I tried the way you suggest it works great. But there is a problem it can be a expensive call, cause it goes in WndProc all the time cause events are firing all the time. Is there another way, like just detach that attached event. I will be really thankful to you.
|
|
|
|
|
Hi,
This code works on 2000/XP plateform but not on NT4 SP6a
[code]
socket.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.HeaderIncluded,1);
[/code]
Does someone have an idea why ?
Thanks.
|
|
|
|
|
Thanks to those who answered earlier. I have two combo boxes which show the databases and tables in my DB. When I change the table combo, the DG shows the tables contents. The code now looks like this:
m_dsTables.Clear();
dataAdapter.Fill(m_dsTables);
dgTables.Expand(-1);
The call to Clear() stops my grid from having the old data in it, but the old columns are still there - how do I delte them ?
The call to Expand(-1) expands the + button in the datagrid so I see the word 'table', but I still need to click on this word to show the table. I just want the table to be shown and to remain visible, can I do that programatically ?
This datagrid looks cool, but right now I am overwhelmed by the number of methods it has, and it's not covered in the Petzold book
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
As per usual, it's a case of ask and ye shall work it out yourself.
m_dsTables.Clear();
dataAdapter.Fill(m_dsTables, m_sDBName);
dgTables.DataSource = m_dsTables.Tables[m_sDBName].DefaultView;
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
As per usual, it's a case of ask and ye shall work it out yourself.
You say this after about 10 minutes?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
How do you mean ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
If there are 2 window applications(if run the exe file, it will pop up a window UI, and input the parameters there). The first one is to do the file format convertion of A to B, and the second application is to do the file format convertion of B to C. Now I want to write a Console application in C# which will call these 2 applications to do the job of converting A to C. Anybody knows how to do it? Thanks!
|
|
|
|
|
How do I pass an array from C# to a COM object.
What is the method parameter syntax for COM object and how does C# use the COM object
|
|
|
|
|
I do something like that:
<br />
public int[] ColumnOrderArray<br />
{<br />
get<br />
{<br />
int iCount = m_ctrl.Columns.Count;<br />
int[] array = new int[ iCount ];<br />
<br />
IntPtr ar = Marshal.AllocHGlobal( iCount * Marshal.SizeOf( typeof(int) ) );<br />
Marshal.Copy( array, 0, ar, iCount );<br />
<br />
WindowsAPI.SendMessage( m_ctrl.Handle, LVM_GETCOLUMNORDERARRAY, iCount, ar );<br />
Marshal.Copy( ar, array, 0, iCount );<br />
Marshal.FreeHGlobal( ar );<br />
return array;<br />
}<br />
set<br />
{<br />
int iCount = m_ctrl.Columns.Count;<br />
if( value.Length > iCount || value.Length < iCount ) return;<br />
<br />
IntPtr ar = Marshal.AllocHGlobal( iCount * Marshal.SizeOf( typeof(int) ) );<br />
Marshal.Copy( value, 0, ar, iCount );<br />
<br />
WindowsAPI.SendMessage( m_ctrl.Handle, LVM_SETCOLUMNORDERARRAY, iCount, ar );<br />
Marshal.FreeHGlobal( ar );<br />
}<br />
}<br />
For better solution look into MSDN by search criteria: Array NEAR COM NEAR Marshal
Alex Kucherenko
|
|
|
|
|
The following code snippet:
namespace myns
{
///
/// ADO.NET data access using the SQL Server Managed Provider.
///
public class Database : IDisposable
{
public int RunProc(string procName)
{
this.close();
}
private SqlCommand CreateCommand(string procName, SqlParameter[] prams)
{
open();
}
private void Open()
{
....
}
public void close()
{
....
}
}
}
I want to know why he use this.close(),but not this.open();
Or open(),but not close()?
Does it relate to public or private define?
I am not using "this" pointer much.
So please give me some guiding or introduce me some online resources.
Thanks.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
Generally the only reason to use this is to get a list from intellisense. The 'this' scope is implied, it will be the first to be looked up, I believe. I doubt there is a reason stronger than that.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Also for disambiguation in, e.g., parameterised construction...
class Customer
{
Customer(string firstName)
{
this.firstName = firstName;
}
private string firstname;
}
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
Also for disambiguation in, e.g., parameterised construction...
Is that a word? I like the sound of it, as it rolls off the tongue so speakeasily!
Mike Stanbrook
mstanbrook@yahoo.com
|
|
|
|
|
I also like the word "defuse"... you know, the opposite of "confuse"
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
there is a very good reason.
consider inheritance....
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I, too, am still learning about all of this stuff. So I probably know only enough to get myself in trouble.
This is what I know so far about this
If you have multiple threads of an object, I believe that this will differentiate between current thread and some other thread. (or maybe the parent thread(???))
In all of the web examples I've seen there is a heavy use of this for accessing the form fields.
In inherited classes, this also identifies you are refering to a property/method within THIS class vs. the BASE class. (even though you cannot access base methods WITHOUT the base qualifier!)
With the exception of those two reasons, this just makes it easy to pull up an intellisense box while coding.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Need a function that will return certain system information into a text box.
User Name
Computer Name
Logged into Domain (Yes or No) If Yes then the Domain Name
Logged into Workgroup (Yes or No) If Yes then the Workgroup Name
OS Version
Any Service packs installed?
Listing of Mapped Drives
Thanks,
Derek
|
|
|
|
|
|