|
G'day all
I've almost finished working onn a word processor and last night somethin very weird happened. I added a new blank tab to my sexy tab control and saved changes, then I thought I'd give it a rest and turn off the computer. Well, this morning, I switched on and to my surprise, all my combo boxes, buttons (68, to be exact) had all been removed from my toolStrip. Now, The code for each of my controls is still in the code view but the only things missing are the ones inside the toolStrip (tab control is still there).. Has anybody had this problem before? Does Visual Studio have some magical invisible button that I must have unknowingly clicked to remove those controls? Any thoughts on this? I'm mystified...
regards
jay
|
|
|
|
|
Hi Jay,
I’ve seen this many times in my own projects but have [Edit!] never found out why. The most common post in internet forums suggests that the reason is the presence of duplicate resource files but that has never been the case in my situation. I always find that the code to add the controls to the toolstrip has been removed by VS and it is a simple matter to edit the designer file to fix this.
A simple example:
Before the error
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Status});
this.statusStrip1.Location = new System.Drawing.Point(0, 636);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 21, 0);
and after the error
this.statusStrip1.Location = new System.Drawing.Point(0, 636);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 21, 0);
I hope the fix is as simple for you and if you do come up with a reason for the error please post back as I'd love to know!
Alan.
modified on Saturday, May 23, 2009 3:08 PM
|
|
|
|
|
Thank you for the reply and code Alan, I'll be trying to figure out why this has happened and will definately post the reason for it if I can figure it out.
regards,
jason pezzimenti.
|
|
|
|
|
I often have a similar problem. All my buttons, comboBoxes, textBoxes, and checkBoxes suddenly disappear, but my groupBoxes and other containers are still there. If I click and drag the select the region containing the buttons, etc. then their outlines all show up. Then I just slightly resize one of them (affects them all since they're all selected) and like magic they all show up. Then I Ctrl+Z the resize and everything's back to normal. Still haven't figured out why this happens. Could be the resource file issue mentioned above, but I haven't really checked.
Dybs
|
|
|
|
|
Never underestimate the power of the backup! I have a scheduled task that runs every couple of hours and copies all my current working project files to a backup directory (it creates a new time-stamped directory each time).
At worst I might lose a couple of hours work, which is a nuisance but not a disaster.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Videos provide look into how you can support Windows 7 in your applications.
MSDEV.com[^] has produced a set of videos giving developers a look into Windows 7 coding. You can view the videos in the series main page, A Developer's First Look at Windows 7[^].
This series introduces Windows 7 with an emphasis on those new features that will be of most interest and use to developers. It consists of: two introductory sessions, one focusing on the new user interface, and one on behind-the-scenes features, two hour-long sessions that cover compatibility and security issues, six shorter sessions which focus on coding for a single new feature.
For more information, see See Windows 7 From a Developer Point of View in msdev.com Videos[^].
|
|
|
|
|
I have all the code necessary (I think) to perform a drag and drop into word... but I am having trouble with pictures... any kind of Bitmap or Image does not drop properly into word, it does something but then acts as if I didn't drop anything it understood.... However, the same code works for dragging and dropping onto other office apps (e.g. Excel and Powerpoint).
The code looks like this:
<br />
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
if (_mouseIsDown)<br />
{<br />
IDataObject obj = new DataObject(DataFormats.Bitmap, pictureBox1.Image);<br />
this.DoDragDrop(obj, DragDropEffects.All);<br />
}<br />
}<br />
Any one have any idea what I'm doing wrong? (and for the record, I have tried it without using IDataObject as well, just directly putting the image into the data argument... oh and I also tried creating a "new Bitmap(pictureBox1.Image)" and putting that in the data argument...
To no avail....
A) Can anyone reproduce the issue at hand
B) Does anyone know what I'm doing wrong? Do I need to use OLE directly or something?
Thanks
Chadwick Posey
=============================
I'm a developer, he's a developer, she's a developer, we're developers, Wouldn't ya like to be a developer too?
|
|
|
|
|
Welp this is as close as I could figure out.
You cannot do it directly in memory (as far as I can tell), but here is the code emulating something close to dragging and dropping a file from explorer into word:
<br />
string[] files = new string[1];<br />
files[0] = @"C:\someimage.jpg";<br />
IDataObject d = new DataObject();<br />
d.SetData(DataFormats.FileDrop, files);<br />
<br />
if (this.DoDragDrop(d, DragDropEffects.Copy) == DragDropEffects.Copy)<br />
{<br />
}<br />
Still cannot figure out why I cannot just drag and drop an image directly though.... would love to know what I could do differently.
=============================
I'm a developer, he's a developer, she's a developer, we're developers, Wouldn't ya like to be a developer too?
|
|
|
|
|
Hi All,
Just came across a strange issue recently.
Maybe its a bug in the framework or something ?
I have 2 processes running , each with its own winform UI, say host application and external application. The host application has a user control and a context menu defined for that user control, plus some blank panels. The external application also has a user control and context menu defined on it.
Now lets say do a SetParent across processes(i know, i know but that`s what the applications must do right now), with the host process` panel as the parent handle, and the external application`s user control is made its child window, then the context menu`s show unusual behavior i.e we can have both their context menus visible simultaneously !
I`m using the contextmenustrip class of dot net 2.0 and this issue doesn`t seem to occur for the older 1.1 context menu classes (in the same scenario).
Is this a known issue with the newer 2.0 class ?
Are there any workarounds to rectify this behavior ?
Is there any way I can get to know the context menu started, closed events across processes if required?
Any help is most appreciated.
Thanks in advance.
|
|
|
|
|
How to use windows application with in the LAN developed in vb.net 2005 with sqlserver express edition 2005
had problem in connnectiostring mapping
|
|
|
|
|
Don't post twice, check out this site[^] for more information about connection strings, make sure when you reference an IP it is your LAN IP (192.168.x.x), not local (127.0.0.1)
|
|
|
|
|
i hav developed vb.net windows appliction and backend with sqlserver
and instaled in my pc how to use that app. from other system.
plz help me.........
|
|
|
|
|
Do some frakking research before asking a question - see the first item in this search [^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I've been working on automating a file download from the swift.com website. I don't know if this makes a difference but the site uses the Apache webserver. The documentation from SWIFT stresses that they're using the Apache HTTP Client Library, but their sample code is in Java, so that might be why. I assumed that a web request is a web request, regardless of the library you use to create it, but here I am asking for help, so maybe my assumption is incorrect. I've included a portion of the code I wrote to download the file.
...
WebRequest myReq = WebRequest.Create(URL);
string username = "me@mydomain.com";
string password = "myPassword";
string usernamePassword = username + ":" + password;
CredentialCache mycache = new CredentialCache();
mycache.Add(new Uri(URL), "Basic", new NetworkCredential(username, password, "swift.com"));
myReq.Credentials = mycache;
myReq.PreAuthenticate = true;
myReq.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes(usernamePassword)));
myReq.Proxy = WebProxy.GetDefaultProxy();
myReq.Proxy.Credentials = CredentialCache.DefaultCredentials;
<-- Error occurs on the next line: The remote server returned an error: (401) Unauthorized -->
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader sr = new StreamReader(receiveStream, Encoding.UTF8);
StringBuilder bicFile = new StringBuilder();
...
Anyone care to shed some light on this for me? I've logged into the site using the credentials so I know I have them right. Cross posted in C# and Windows-Forms forums.
Mike Devenney
|
|
|
|
|
Mike where you able to solve this, I am facing the same problem, if you have a solution for this please share
Thanks,
Sridhar
bc_sridhar@yahoo.com
|
|
|
|
|
How do you display a tooltip in datagrid for .net 1.1?
|
|
|
|
|
Ok, so I've created a sample C# forms application, and want to ensure that it can be easily localized to other languages. I'd like all my strings etc in resource files, and satellite assembly files looks like a decent way to go about this.
I've found several articles, on CP and MSDN etc, they all mention to create a windows forms application. Then right-click on the project and select Insert New Item and then select "Assembly Resource". I have many installed templates, but that's not listed. Has this changed in VS2008? Would "Resources file" work ok?
For example, see here, Approach A, step 1.
thanks,
Mark.
|
|
|
|
|
hi all!
i need to develop application that have many simultaneously ran tasks. each task have its own logger file and prints log info in to some window control.
i've tried to investigate how to log this data to UI window but found out nothing.
i need some multiline listbox or textbox that can contain a lot of strings and be fast like VS output window(text box) or microsoft spy(listbox).
i think that containing of all log lines in UI window is not a good idea... may be it would be better to write all log data only to log file and in to UI window print lines depending on scroll-bar position reading them from log-file?
what do u think about this? may be u had the same problem and can recommend me better solution?
10x!
ISQ 469907496
|
|
|
|
|
Hi,
most of the time I log to both a file (which during debug gets opened and closed for each line, so I also catch the last line before a crash) and a listbox. IMO a TextBox is terrible for logging, since it continuously concatenates all text lines, a quadratic and expensive operation you do not need.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Luc Pattyn wrote: IMO a TextBox is terrible for logging, since it continuously concatenates all text lines, a quadratic and expensive operation you do not need.
Interesting, never thought of that bottleneck right there, going to make me review a couple of times a textbox is present for debugging
|
|
|
|
|
I have a Text box on a panel and want to set to value for it through the another form.
pls help me
by
srinivas
|
|
|
|
|
Do some research before asking the 2nd most asked question ever try this clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
What's the first?
|
|
|
|
|
How to read/write data to a database!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|