|
And everything compiles with no errors or warnings?
As a "work around" (backup your entire project folder FIRST!), I'd get into the designer generated code of the form and remove all traces of your control being instantiated. Yo ushould then be able to go back to the designer and see the form again. Drop a single instance of your control back onto the form, with the same name it had previously as see what happens. If the designer doesn't crash, you'll probably be in good shape to add the remaining instances, again, naming the same as they were before.
If it does crash, then you've got a problem in your control somewhere, either in it constructor (New), or in some code that does painting or some other event.
Sometimes Visual Studio looses it's mind and a control that used to work no longer does because the designer generated code gets all hosed up. I've found that removing the instances of the "offending" control and readding them usually fixes the problem.
|
|
|
|
|
So yes it run. But I do get Warnings/Errors. The first speaks to the assembly and reference. I then get Type errors saying that variables were not declared in the form code - when in fact they were.
"remove all traces of your control being instantiated"
What do you mean by this? I can get into the form generated code but I am not sure what I am looking for or what to do. Do you mean delete all the code in the form generated code?
"Drop a single instance of your control back onto the form, with the same name it had previously as see what happens. "
My panels have a lot of other controls in them. So I am basically removign everything - correct? I have had this problem before and simply rebuilt. What's to say that this will not keep happening?
"If it does crash, then you've got a problem in your control somewhere, either in it constructor (New), or in some code that does painting or some other event"
Where would the problem be in the constructor (NEW)? I believe my type errors refer to these (i.e. variable not declared).
Regards
EM
|
|
|
|
|
ExcelMonkey wrote: What do you mean by this? I can get into the form generated code but I am not sure what I am looking for or what to do. Do you mean delete all the code in the form generated code?
Not all of it. That would be pretty distasterous.
Look through the code an it'll be pretty clear what's going on. At the bottom, there's a bunch of lines that start with Friend WithEvents . These declare the variables that will hold the instances of your controls. You'll also notice that they have the names that you give the controls in the Name property you see in the Properties box.
Just find and remove the lines that correspond to your control instances, something like
Friend WithEvents CollapsibleControl1 As something.CollapsibleControl
Then scroll up the code and you should see a section divided by comments for each control on the form. Find the sections that correspond to each on your control instances. They'll all start with a small comment section showing the name instance of the control. Just delete the comments and the code directly below it, until you reach the next set of comments.
'
'CollapsibleControl1
'
Me.CollapsibleControl1.someProperty = someValue
Me.CollapsibleControl1.someProperty = someValue
Me.CollapsibleControl1.someProperty = someValue
'
'Form1
'
....
You'll see squiggly red lines under all of these lines of code (except the comments of course). That should make those lines stand out to you.
Lastly, scroll up some more and you'll see the code that creates the instances of the controls. Each line will look something like:
Me.CollapsibleControl1 = New something.CollapsibleControl
Me.CollapsibleControl2 = New ...
These should also have squiggley red lines under them. Delete these lines too and save the project. You should then be able to go back to the form designer, close, then reopen the form giving you the problems.
|
|
|
|
|
One last question. My form has 5 Collapsible Panels on it. Each Panel is loaded with additional controls. Does deleting the code - as mentioned above - actually remove the existing Collpasible Panels from the form. That is, if upon doing so, and I can call up my form, will the 5 panels no longer be there?
The reason I ask is that removing the panels will remove every other control as well. There is an abunance of code (i.e. my main sub) behind one of the controls and also the code generated by the form will have an abundance of code sitting it as well (i.e. code associated with all the other controls which were in the collapsilbe panels). So if these other controls are removed when I remove the collapsible panels, then doesn't this mean that the current code which is generated by the form will continue to fail as the controls that support this code are now missing too?
I will give this a look at tonight. My concern here is that I have delete my entire form (i.e. controls/code), rebuild, and fear it happening again at a later date.
Thanks
EM
|
|
|
|
|
ExcelMonkey wrote: Each Panel is loaded with additional controls. Does deleting the code - as mentioned above - actually remove the existing Collpasible Panels from the form.
Yes.
ExcelMonkey wrote: The reason I ask is that removing the panels will remove every other control as well.
It won't remove the controls, but you'll have to comment out the lines that add those controls to the Controls colection of your panels, or just replace your controls with the standard Panel control.
ExcelMonkey wrote: when I remove the collapsible panels, then doesn't this mean that the current code which is generated by the form will continue to fail
Yes, but you're not going to recompile the project after removing the controls. You have to put your controls back on the form after they've been removed. This will regenerate the designer generated code for your controls.
You're just removing the designer generated code, not the code handling all the events on the form.
|
|
|
|
|
Hello,
How would you make a form invisible/opacity 1% while keeping a label within the form completely visible?
Thank you!
|
|
|
|
|
You can't. It's the entire form, including all of it's controls, or nothing.
You MIGHT get away with having a duplicate form layout on another borderless form, which has a transparency key setup and is the size of your existing forms client area, and put a label on that form, then place it over the top of your existing form. I don't know if it would work, but it's worth a try.
|
|
|
|
|
hi all,
i execute a simple query which update two fields of table.one field is id and second field is MEMO type. in memo field i store data of rtf file but "Query is too complex" error occured. I use MSAccess database .
Please guide me
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Without seeing the code that threw the error, it's impossible to tell you anything useful.
|
|
|
|
|
I have created one vb.net application, which runs my crystal reports perfectly fine.
And I have created installation of my application.
now when i install this application on my system or other system....my crystal report gets error.
that means my crystal report not getting path where actual report is stored...
I think i have a problem while deploying application or i have to do something on my code so that i can get path of my crystal report.
please anyone can help me on this problem....
Som !
|
|
|
|
|
It would be wise to show us the exact error message you're getting.
If it's a path problem, try building and specifying the complete path to the report file and not just assume that the report is in the "current directory".
|
|
|
|
|
I have an records near about 2.5 lac but excel sheet(sheet1) can contain maximum of 65 thousand now how can I transfer the records to the excel sheet . my application gets hang.
|
|
|
|
|
Excel simply isn't going to handle this. Excel's limit cannot be changed. The only way you'll get more rows is to add more sheets. But, even if you do this, I doubt you'll get 2.5 million rows into Excel, no matter how many sheets you use.
It sounds like you're trying to treat Excel as a database, something which it's not designed to do.
|
|
|
|
|
I wonder if anyone can help me. I am using VB.Net 2003
I have a grid that I want to format values in that grid e.g. format to 2 DP or righjt align etc
I tried the following and it does not seem to work.
dr(1) = format(objDR("VGFLOR"), "#0.00")
When I display in the command window it looks fine but displayed it is still the same e.g. 12.3 but I want 12.30 to be displayed.
This is a sample of how I am setting up my grid. There is code missed out.
'setup the grid columns
dt.Columns.Add(New DataColumn("Name", GetType(String)))
dt.Columns.Add(New DataColumn("Department", GetType(String)))
dt.Columns.Add(New DataColumn("Salary", GetType(Double)))
Do Until objDR.Read = False
dr = dt.NewRow
dr(0) = objDR("NAME") 'Name
dr(1) = objDR("DEPT") 'Department
dr(2) = objDR("SALARY") 'Salary
|
|
|
|
|
You don't format the values in the DataTable. You format them when displayed in your DataGridView, or whatever else you're using to show the data. In the DGV, you'd supply formatting information in your column definitions.
Dim col As New DataGridViewTextBoxColumn
With col
.HeaderText = "Header..."
.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.DefaultCellStyle.Format = "#0.00"
End col
Dgv1.Columns.Add(col)
|
|
|
|
|
I have a treeview and each node has an icon. At runtime, the icons are appearing with a blue border which makes result very ugly. I use the same imagelist for a listview on the same form and the icons are being rendered perfectly without the blue boarder. Is there something in the system settings or whatever settings that i need to change or be aware of to get rid of this problem? The Icon size is 16X16 (same for the original icon, imagelist setting and treeview icon size) and the color depth is 32bit (highest for my machine)
Thanks for assisting.
|
|
|
|
|
Do your icons have a alpha channel?? I can't seem to duplicate your problem at all and that alpha is about the only thing I haven't tried.
|
|
|
|
|
Hi Dave, thanks for your efforts. The icons are standard windows shell32 icons, i actually get them from the system files. a weird thing happened yesterday, I duplicated the troublesome part of the system outside the application and it works well (icons are rendered well) but the moment i took the form back into the project, it behaved as before. Here are the 2 outputs side by side, the left one is the correct one running independently, on the right one after i add it to my windows project, with nothing changed.
http://www.4shared.com/file/35005243/44721ad3/Distorted.html[^]
|
|
|
|
|
OK. The problem isn't what I was thinking of. I still didn't come up with that problem either.
Is the color depth on the bad machine 32-bit?? It almost looks like 32-bit icons being rendered in 16-bit color. I'd also try updating the video drivers on the bad machine too. Hmm...
|
|
|
|
|
The shots were taken on same machine, running at the same time, i simply dragged the 2 windows side by side. I load the imagelist from the windows shell which has icons of size 32,32. the treeview is set to show a 16,16 icon size. the color depth is 32bits. (code and settings in both shots is exactly the same, the only difference is that the one in the right is wat my application is outputting and i desire wat's on the left.)
|
|
|
|
|
OK. I kind-of see what you're getting at now. Ummm...A bunch of questions come to mind.
1st, how to duplicate this "outside of your project". You said that you brought the form back into the project at it started to fail again. What dod you do here? Did you create a seperate project that did the same thing and it worked as expected??
How did you get the icons from the Shell?? Are they sitting on your drive in seperate files or as resources in your app?? Did you use an ImageList setup exactly the same between the two projects??
|
|
|
|
|
|
hi all,
in my application im having code to convert the datagrid values to excel sheet but when it is saving it is taking .html extension instead if .xls, pls help me to sort out.
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-position", "attachment;filename=FileName.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.ms-Excel"
Me.EnableViewState = False
Dim stringwrite As New System.IO.StringWriter
Dim htmlwrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringwrite)
Dim da_GetAllBooks As SqlDataAdapter = New SqlDataAdapter("GetAllBooks_Proc", Con)
da_GetAllBooks.SelectCommand.CommandType = CommandType.StoredProcedure
da_GetAllBooks.Fill(_dataSet, "AllBooks(0)")
Dim index As Integer = 0
For index = 0 To dg_AllBooks.Columns.Count - 1
dg_AllBooks.Columns(index).SortExpression = True
Next
dg_AllBooks.DataSource = (_dataSet.Tables("AllBooks"))
dg_AllBooks.DataBind()
dg_AllBooks.RenderControl(htmlwrite)
Response.Write(stringwrite.ToString())
Response.End()
help me
|
|
|
|
|
Your code is confusing. You seem to be trying to i) output an Excel file and ii) display a DataGrid at the same time. You can't do both - your page can't return binary content and HTML at the same time. To dynamically build an Excel spreadsheet, do a search on CodeProject or Google for the JET OLE Provider. You should find plenty of examples.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
HI all
I want help on following issues its a vb.net application
1) want to open excel application inside my form
2) want to create number of excel sheet which depends on a number specified in a text box.
3) want to name the sheets as for example sheetname1, sheetname2......
Pl help me out.opening the excel application is biggest problem i am facing with lots of exception
Regards
Prakash Mishra(Banglore,India)
|
|
|
|