|
Hi
I am setting up a simple web form, and for some reason, the controls that I have put on the page are not showing properly. I have 3 labels and 3 link buttons. They are set up in a column, one after the other, all aligned along the left edge. However, when I compile, they all show up as labels, and rather than showing up properly, they show up in a row.
I am pretty sure that it is a simple solution, but I'm stumped.
Any help would be appreciated.
Derek
|
|
|
|
|
Are they laid out in a table, do they have <br> tags between them, or did you lay them in a column, but not provide any HTML to make them look that way in the browser ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian
Basically, I dragged and dropped the labels from the control list, then the link buttons. In the form layout, they show as 6 controls in 1 column, no table, no tags. I have never had to use HTML to make them line up before. Whenever I have done this before, the controls have shown up exactly as I placed them in the form layout.
Derek
|
|
|
|
|
The form layout page is crap, you should never use it, especially in VS2003 ( you didn't say which you're using ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
OK< I am using VS 2002. Another thing, the link buttons are just showing up as text, not as a link. Any ideas ?
|
|
|
|
|
Sorry for the multiple post, but this is how the page shows up
Assignment 4 Inventory System Derek Gruenthaler Products Product Sales Employees
The following are labels : Assignment 4, Inventory System, Derek Gruenthaler
The following are supposed to be link buttons : Products, Product Sales, Employees
I'm lost here
-- modified at 1:28 Tuesday 10th January, 2006
|
|
|
|
|
First of all, NEVER EVER use the design view again. In fact, you should change the defaults so you never SEE the design view again. The design view on 2002 is crap, it makes a total mess of your HTML, sometimes to the point of breaking it.
Secondly, for a link button to show as a link, you need to set it's target or click event. If you've not set these, they show as plain text ( because they don't know where to link to ). Finally, add that <br/> tag between your labels, and they will show up in a column instead of a row. Tables are the most obvious way to align your stuff on a page, but <br> will work for one column. Also, I believe it's better to use divs, spans and css, but to be honest, I have no idea how that is done.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Give me a latest code in visual basic 6.0 to devlope a mobile application
sandip
|
|
|
|
|
Welcome to Code Project. I see you're new, and this may well be the most English you've spoken in a single day. So, I'll be polite.
What you've posted is a demand. What I think you wanted to do is ask a question.
And furthermore, MSDN is full of samples to answer this sort of generic question. You should ask here when you have a specific problem.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello!
I am developing a cutom module in DotNetNuke.
I have written the correct NameSpace and Assemblyname but I
just keep getting this error in Visual Studio.
Errormessage:
"An unhandled exception of type 'System.MemberAccessException' ocurred
in mscorib.dll
Additional information: Cannot Create an abstract class."
Exception:
System.TypeInitializationException
----Inner exception: System.MemberAccessException
----Message: "Cannot create an abstract class."
----Source: mscorlib
Code:
Imports System<br />
Imports System.Web.Caching<br />
Imports System.Reflection<br />
<br />
Namespace INVID.DNN.Modules.HelloWorld.Data<br />
<br />
Public MustInherit Class DataProvider<br />
<br />
#Region "Shared/Static Methods"<br />
' singleton reference to the instantiated object <br />
Private Shared objProvider As DataProvider = Nothing<br />
<br />
' constructor<br />
Shared Sub New()<br />
CreateProvider()<br />
End Sub<br />
<br />
' dynamically create provider<br />
' This sub gets called, It is calling the methods that will raise the exception<br />
Private Shared Sub CreateProvider() <br />
objProvider = CType(Framework.Reflection.CreateObject( _<br />
"data", _<br />
"INVID.DNN.Modules.HelloWorld.Data", _<br />
"INVID.DNN.Modules.HelloWorld"), DataProvider)<br />
End Sub<br />
<br />
' return the provider<br />
Public Shared Shadows Function Instance() As DataProvider<br />
Return objProvider<br />
End Function<br />
#End Region<br />
End Class<br />
End Namespace
Code that is called in (The Step were it goes wrong) Components\Shared\Reflection.vb:
' dynamically create an object from a TypeName using a CacheKey<br />
Public Shared Function CreateObject(ByVal TypeName As String, _<br />
ByVal CacheKey As String) As Object<br />
<br />
If CacheKey = "" Then<br />
CacheKey = TypeName<br />
End If<br />
<br />
' use the cache for performance<br />
Dim objType As Type = CType(DataCache.GetCache(CacheKey), Type)<br />
<br />
' is the type in the cache?<br />
If objType Is Nothing Then<br />
Try<br />
' use reflection to get the type of the class<br />
objType = Type.GetType(TypeName, True)<br />
' insert the type into the cache<br />
DataCache.SetCache(CacheKey, objType)<br />
Catch exc As Exception<br />
' could not load the type<br />
LogException(exc)<br />
End Try<br />
End If<br />
' dynamically create the object<br />
Return Activator.CreateInstance(objType) ' This line raises the error mentioned before<br />
End Function
Any help on this error will be much appreciated!
Best regards rob_pro@hotmail.com
|
|
|
|
|
I think the error is perfectly clear. You're trying to create an instance of an abstract class. Abstract classes (MustInherit in VB) must be inherited by another class that provides the implementation code.
You declared your Data class abstract yourself with this line:
Namespace INVID.DNN.Modules.HelloWorld.Data
Public MustInherit Class DataProvider
#Region "Shared/Static Methods"
' singleton reference to the instantiated object
Private Shared objProvider As DataProvider = Nothing
If you want your Data class (bad choice of name too) to be created as a concrete class on its own, you have to get rid of the MustInherit keyword.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 13:55 Sunday 8th January, 2006
|
|
|
|
|
Actually i somewhat tried to make the SqlDataProvider class (SqlDataprovider.vb) abstract (MushInherit) which i discovered later.
Of course i cannot create an abstract class of SqlDataProvider with Reflection. I guess i was tired when i was coding!
Thanks for answering very fast!
|
|
|
|
|
The code here appears to be that produced by the code generator when you create a DNN Module project in Visual Studio. The class is abstract because you are supposed to inherit from it with the concrete code to access the specific database that you need. This design is because many modules in DNN are released that can use multiple back end databases and the abstract class provides a way for the module to talk to the database without actually knowing what database it is talking to.
There is will also be a DataPovider project which you add to accompany your module project. The DataProvider project contains the code for a concrete implementation to a single database - this leaves you free to provide as many data providers as there are databases that you wish to support.
Although I use DotNetNuke I am not an expert with it - You might find that the best place to ask a question on it is on their official forums http://forums.asp.net/90/ShowForum.aspx[^] The forum stickies also point you to various documentation on the subject. There are also books on DotNetNuke which you may like to read.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hello!
I have bought both books on DotnetNuke 3.0 to help me with this project.
"Building Websites with VB.NET and DotNetNuke 3.0"
and...
"Professional DotNetNuke ASP.NET Portals".
...which I find most interesting!
Thank you very much with answering my question very fast!;)
|
|
|
|
|
In the past, I've generated reports for my code purely with vb.net code. I do not use databases at all; all data is stored in classes within the code. Is there a manner in which collections of class objects can be utilized by Report software (such as Crystal Reports) or are there other report applications/components that I should look into? Ease of report generation is getting important, but I cannot implement database-versions of my code. Any suggestions or examples?
|
|
|
|
|
|
Unfortunately, this does pretty much what my code already does--designing the forms in *code* (rather laboriously I might add in my case). I'm really looking for something that will allow the report to be created via a designer of some sort.
|
|
|
|
|
How long can you wait?
(I am adding visual designers stuff to it based on the "Shapes" sample but it is not going smoothly at present...)
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I'm a patient man
I'd be very interested in trying it when you get the designers working. Being able to use a visual designer to arrange a header, body & footer for a form, with text and picture fields would go a long way to avoiding code-based forms.
|
|
|
|
|
There is some limited designer support in this version in GotDotNet[^] - i.e. when you change the properties of a section in design mode it redraws the page to show the change.
It does not do selectiong / dragging / resizing though...yet
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi,
Uhm, I've got a small little app, at the moment, not even 1,000 lines. This is a GDI intensive application, I can't declare more than 26 LinearGradientBrush types.
Error: Exeception of type 'System.OutofMemory.Exception' in system.drawing.dll
How can I increase the memory limit? The app is not even 64kb, mem usage according to the task manager is arround 20MB (due to allot of other things that is loaded as well), and the code itself, isn't even over 1,000 lines.
26 drawing objects is not even a third of all the objects I need (this is a mere 50% of my background only).... I need to get this sorted
Can anyone give some insight???
Thanks,
Chris.
|
|
|
|
|
You're exceeding the number of GDI handles allowed for one process. Make sure you call Dispose() on all Pens, Brushes, Graphics etc. you create.
The garbage collector only manages the memory, so it doesn't notice when you're running out of handles and does not collect soon enough.
|
|
|
|
|
Like the other poster said, you're not running out of memory and there is no way to increase the limits you're running into.
Yes, you MUST Dispose of any and all GDI objects when you're done using them. The sole exception being a Graphics object that was passed to you, one that your code did not create.
Create, draw, Dispose... It's that simple. You CANNOT get away with creating a bunch of objects and using them "globally" throughout your code. It's very bad practice. You've bumped into one reason why.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hmm, then I have a problem.
I do already dispose of everything... It's really a matter of setup a pen, setup a brush, draw the line, and dispose of both the objects - through the entire drawing....
<br />
Dim Brush27 As New LinearGradientBrush(New Point(212, 267), New Point(212, 297), Color.Black, Color.Black)<br />
Dim BrushPen27 As New Pen(Color.Black, 5)<br />
BrushPen27.Brush = Brush27<br />
PCRT.DrawLine(BrushPen27, New Point(212, 267), New Point(212, 297))<br />
BrushPen27.Dispose()<br />
Brush27.Dispose()<br />
That's how every single line is drawn. Brush1 through to Brush27, and BrushPen1 through to BrushPen27. For interest sakes, do I need both????
The moment I Dim brush28, memory error... I do really have a crapload of things still to draw, and they need to move arround aswell (animation)... Please tell me there is a solution?
<br />
Private Function GetGraphicsObject(ByVal bp As PictureBox) As Graphics<br />
Dim bmp As New Bitmap(bp.Width, bp.Height)<br />
Dim Grph As Graphics<br />
Dim sm As SmoothingMode<br />
<br />
bp.Image = bmp<br />
Grph = Graphics.FromImage(bmp)<br />
Grph.InterpolationMode = InterpolationMode.HighQualityBicubic<br />
Grph.SmoothingMode = SmoothingMode.HighQuality<br />
Return Grph<br />
End Function<br />
<br />
Private Sub DrawPCRT()<br />
' Top two nodges<br />
Dim Brush1 As New LinearGradientBrush(New Point(210, 20), New Point(210, 48), Color.FromArgb(255, 255, 255), Color.FromArgb(255, 255, 255))<br />
Dim BrushPen1 As New Pen(Color.FromArgb(255, 255, 255), 4)<br />
BrushPen1.Brush = Brush1<br />
PCRT.DrawLine(BrushPen1, New Point(210, 20), New Point(210, 48))<br />
Brush1.Dispose()<br />
BrushPen1.Dispose()<br />
<br />
* Allot of code removed, all drawing different lines *<br />
The above is drawn from my Form1_Load routine, drawn on a PictureBox.
form_load
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
PCRT = GetGraphicsObject(PictureBox1)<br />
DrawPCRT()<br />
If PFD.Initialize = True Then<br />
RemoteClassMainThread.Start()<br />
End If<br />
End Sub<br />
Thanks guys,
--
Chris.
-- modified at 16:26 Sunday 8th January, 2006
|
|
|
|
|
Ok... Saw what I'm doing now... Optimised, and on we go :P
Only have 8 Pens so far, no gradients.
On a different note now... Will it be better (faster) to do the first, or the second. What's going to be best as far as performance goes...
<br />
Dim myPen As New Pen(Color.White, 20)<br />
g.DrawLine(myPen, New Point(50,1), New Point(50,21))<br />
or...
<br />
Dim myPen As New Pen(Color.White), 1)<br />
For i As Integer = 1 to 20<br />
g.DrawLine(myPen, New Point(50,1), New Point(50, 1 + i)<br />
Next<br />
The second example is perhaps not accurate as far as co-ordinates go, but the idea is there. The tradeoff as I see it is use one pen for each color, vs. use one pen for each color + width.
Therefore, on the later, you will use less memory because you have less pens declared, but, I would suspect you will loose speed, because you'll have allot more drawing to do.
Which is best - especially considering that I have *allot* of drawing to do...
Thanks for the help. Not only is my code base significantly smaller now, but my memory / file handles issue is also something of the past now. The question is just for now long
--
Chris.
|
|
|
|
|