|
I believe GetShortPathName[^] will do what you need. I would like to think there is an easier way, but I am not aware of one.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
tnx for your reply. But it's not the style i wanted. i want get full dos mode path like it:
C:\Docume~1\Sina\MyDocu~1\MyPict~1\p1~1.jpg
|
|
|
|
|
That IS the "DOS mode" path, as you call it.
|
|
|
|
|
I believe what I gave you should have given you the dos path, in the format that you showed. If it gave you something different please show me what it was, as I am confused how this isn't meeting your needs.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Wow.Great.
Tnx for your reply.
|
|
|
|
|
Having become lazy, I've done so much as to check MSDN.
Basically I have a panel, and a bunch of groupboxes which I would like on that panel.
The groupboxes are hidden/displayed and moved depending on the user instructions at runtime. It all worked great without the panel (simply on the form), but with it, it doesn't.
The panel contains a button to hide it, which no longer works, and the groupboxes don't appear in the panel, regardless of whether or not I have them in the panel within the designer.
My question isn't fix it but, is there some trick I've missed with panels, to make their contents display? It works, in that it displays the button and the button changes on mouseovers, but it doesn't work.
It seems that the panel doesn't redraw itself entirely, but I added some calls to refresh it after moving the panels which has no effect.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
Without some brief, relevant snippits of your code it would be hard to help you. Also, don't call yourself lazy, even if you are; admitting to being lazy, and yet expect that I, or anyone else here help you, seems insulting and as a general rule I tend not to help people who insult me.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
The laziness was about me...because for the last 4 years (before I became more reliant on the internet) I could sit for hours testing and testing until it worked, or I came up with something better. This time I've given in because I know there are plenty of people out there who do nothing but use panels for their interface (and they work).
There's no code needed, I would expect.
All of the following was/is done at design-time.
There's a form. Upon that, are groupboxes. Without any panels, the groupboxes display and the buttons work fine (they execute their click events).
Then I added the panel, moved the groupboxes so that they were [definitely] in the panel, and the relevant buttons too. Now, the buttons appear but do nothing when clicking on them, and the groupboxes don't appear.
All of the groupboxes initially have their Visible property set to false. The buttons are visible.
Hopefully that's clear enough.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
I tried to duplicate your problem doing the following:
added a panel to a form
put a groupbox on the panel
put a button on the groupbox
set the visible property on all three to false.
set the visible property of all three to true on the for double click event of the form.
put messagebox.show("Test") in the click event of the button.
ran the app.
double clicked the form; The panel, groupbox, and button showed.
clicked the button and it worked.
The windows forms designed code for what I did is:
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.groupBox1);
this.panel1.Location = new System.Drawing.Point(72, 56);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(400, 320);
this.panel1.TabIndex = 0;
this.panel1.Visible = false;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Location = new System.Drawing.Point(32, 32);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(336, 264);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
this.groupBox1.Visible = false;
//
// button1
//
this.button1.Location = new System.Drawing.Point(40, 48);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(88, 24);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form2
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(576, 469);
this.Controls.Add(this.panel1);
this.Name = "Form2";
this.Text = "Form2";
this.Load += new System.EventHandler(this.Form2_Load);
this.DoubleClick += new System.EventHandler(this.Form2_DoubleClick);
this.panel1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
Review your forms designer code and see if you see anything weird. If not, try and duplicate your problem in the simplest possible way and outline it as I did above.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Having followed your guide (except, in VB this time ) I get the same results as you and I and any sane person would expect. I had a panel, a visible button which made an invisible groupbox, visible.
The original project still ain't working. The data's working, it seems that the panel can't handle things moving around inside of it.
Thanks for your time, but I'll go bury my head in some strange code for now. There's only so many psychologists willing to help frustrated programmers left.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
Something keeps tickling the tip of my brain. An odd problem I once had when dragging exising controls into a panel. Can't remember the details, but seem to remember (and it will be a huge pain to do this) that I ended up starting over and creating a new form and adding a panel and new controls in the panel and the problem cleared up. Meant I had to copy over all of the other code from the existing form and of course recreating the whole ui itself is a pain, but when you truely have given up it might be worth a try.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Funnily enough, I did just that last night. Had a second project, copied the form and relevant code over. It's the bare minimum to have it working as it was - still doesn't work though.
I daresay I could do it the long way around. There's 4 groupboxes causing problems and each has less than 10 controls on it. Nothing really complex, and there's not exactly a deadline.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
Your groupbox's (if I followed this thread correctly) are not in your panel controls. It can appear on top of or under the panel, but you didn't drop the groupbox from the Toolbox ON the panel. You dropped it on the form, then tried to move it into the panel. This just moves the groupbox over the top of the panel.
All you have to do is add the groupbox control(s) to the Panel's Controls collection:
Panel1.Controls.Add(myGroupBox)
|
|
|
|
|
Unfortunately, I made sure of it. Dragging them over, and then within the panel to the edge of it, it stops drawing outside of the panel. I also checked and the pnlPanels.Controls.Add() lines were all in the designer code, and that was what I got from MSDN - adding those lines to my Form_Load code.
Plus, sometimes (not always) when you drag a control within a panel or a groupbox, the cursor changes and a dotted box appears next to it. Not very obvious if you're working at speed though.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
I've given up. The reason I needed the panel was because I wanted to use GDI to draw on the rest of the window and the panel seemed the easiest way of me not having to draw under the groupboxes. So I figured, dispose of the panel (well, delete it - it's not being created to be disposed :-P) and just add another (complex) rectangle to the GDI code.
Thanks anyway folks, but it seems like one of those bugs that just happens.
Yet another spam post on yet another forum!
I am the lazy one, who sleeps as it suits him, codes what he wishes, and has many years to look forward to.
I love being a student.
|
|
|
|
|
I just need to know how to pass my Date over with the # sign on each side of it. If I run this in the Qurey Builder it works as long as I put # on each side of my date.
So it needs to look something like this....
SQL = "DELETE FROM Pat20VisitDate WHERE (VisitMRNo = '" & MR & "') AND (VisitDate = "& #SelectedVisitDate# &")"
but I have the syntax wrong or something. Is this some type of formatting issue? Does anyone have any suggestions? Thanks in advance!
|
|
|
|
|
I believe you want this.
SQL = "DELETE FROM Pat20VisitDate WHERE (VisitMRNo = '" & MR & "') AND (VisitDate = #"& SelectedVisitDate &"#)"
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Oh and sorry that I never got around to checking back on your post from yesterday. It's been a busy day.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Yes you are right about that SQL statement. I just had the # in the wrong place. I went back to my code and just tried everything until I got it.
Don't worry about not getting back to me. I got it figured out. Thanks for your help!!
|
|
|
|
|
|
If you used parameterized queries, you wouldn't have to worrdy about things like making sure the date is in the correct format, or if the # characters are in the correct place, or escaping other data in your parameters, ...
|
|
|
|
|
Hi Everyone:
Is there a way I can show the records I added and/or modified to a DataSet before I commit them to the database?
I think it is something like MyDataSet.GetChanges.
Cleako - BTW the problem with the dataset primary ID number being off didn't seem to make a difference when I wrote the data out to the SQL Server Database using the SQLDataAdapter.
Thanks,
Quecumber256
|
|
|
|
|
|
Thank you. I going to see if I can adapt it for my use.
Quecumber256
|
|
|
|
|
I need to download from an FTP site. There are an unknown # of files. I have code to download a single file at a time but have problems getting the file names. The error message is invalid username/password when I use Path.GetFiles(strPathName).
|
|
|
|