|
no , does not display any message on closing. I repeat that inside form there's no code.
|
|
|
|
|
It really sounds as if your login form is the culprit, but without seeing some code it is anyone's guess what you are doing.
|
|
|
|
|
Hello !
i'm using vb.net 2013.
I have a situation where I need to have a combobox and a tabcontrol below it.
I've put the combobox at the top and set dock type as Top.
Below I've set the tab control and set the dock type as Fill.
But now the beginning of tab control is covered by combobox.
I've tried to set the tabcontrol's dock type as bottom , but I have empty space between combobox and tabcontrol.
Is there any way to resolve this ?
Thank you !
|
|
|
|
|
You need to change the z-order of the controls. Select the combobox control, then right-click it and select "Send to Back". That should do the trick.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Hello !
I'm using vb.net 2013
1) I have problems running my program on different PC with different monitor and screen size.
when the screen resolution is lower than my form size the form does not fit on the screen and the controls are dragged ut of their positions , the situation does not make better even when I maximize the form to fit the screen. And on larger high resolution screens , the forms becomes too small. Is there any solution ?
2) And another question , the form's size width and height that I can configure inside vb.net , are related with screen resolution ? for example a form with size 968x610 can be fully displayed on a 1024x768 resolution ?
Thank you !
|
|
|
|
|
There are several possibilities to solve your problem.
- you could create forms which size matches to your lowest possible screen-resolution
- your form matches to your screen-resolution and you re-calculate the position (and perhaps also the size) of each control on the form. In this case it could also make sense that you change the fontsize of the involved controls. But this makes a lot of work - you should realize that.
I'm sorry but I don't understood your question 2
|
|
|
|
|
To be more clear for question 2 :
when I choose Form's size Width and height , these numbers does have any relations with screen size or resolution ? For example if a have a form with size 1024x768 and the screen size ( resolution ) is 1024x768 , does this form fits completely on the screen and is full displayed ?
|
|
|
|
|
No, they don't. They are absolute pixel count position, height, and width.
If you pick a size of 1024x768 and the screen size is the same, it'll fill the screen.
|
|
|
|
|
And then how do you explain that a form with size 968x610 goes outside a screen 1024x768 ?
Speaking for form's size the width 968 is greater than 1024(when speaking for screen resolution ) ?
|
|
|
|
|
You would first have to produce some evidence that a form that is smaller than the screen is displayed bigger than the screen.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
I have no idea what your system is setup like, such as setting a custom scaling level in the Display control panel, but normal the form if set to 968x610 WILL BE 968x610.
|
|
|
|
|
I always design for the smallest reasonable screen size. I used to have a graphic as my background that displayed the sizes from 640 - to 1024 but that was a long time ago. Now I make sure my forms fit a 13" laptop at 1024.
I then use a dock type layout where the central control (commonly the gridview) is expandable to fill the area when the user maximises the form.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello !
I'm using vb.net 2013 and Entity Framework 6
I need to implement the INotifyPropertyChanged
I've done that by manually changing the classes.But I have problems , because every time that I make changes on my database , the "update model from Database" on visual studio is almost unusable , so I have to re-create from the beginning the Model.edmx.But after that , all that I wrote for implementing InotifyPropertyChanged is lost , so I have to make from the beginning.
Is there any easy way to do that ?
Thank you !
|
|
|
|
|
This article may help[^]
It's in C#, but you can use a convertor to translate it to VB, such as the one from Telerik[^].
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Hello !
I'm using vb.net 2013 and entity Framework 6.
I'm trying to save a new object and a child object like this :
MyObject ---- id , nm , value
ChildObject ---- id , name , vl , MyObjectID ( Foreign key related with id on MyObject )
Dim obj1 as Myobject
Dim child1 as ChildObject
obj1=new MyObject
obj1.nm="123"
obj1.value=25
obj1.ChildObjects=New List(of ChildObject)
child1=new ChildObject
child1.name="abc"
child1.vl="efd"
obj1.ChildObjects.Add(child1)
context.MyObjects.add(obj1)
Context.SaveChanges
After this code , the obj1 is saved on database , but the child1 is not saved. No error messages.
What can I do ?
|
|
|
|
|
Show the code that defines the Myobject and ChildObject. I'm suspicious of the code that adds a NEW list of ChildObject.
|
|
|
|
|
Partial Public Class MyObject
Public Property id As Integer
Public Property nm As String
Public Property valu As Integer
Public Overridable Property ChildObjects As ICollection(Of ChildObject) = New HashSet(Of ChildObject)
End Class
Partial Public Class ChildObject
Public Property id As Integer
Public Property name As String
Public Property vl As String
Public Property MyObjectID As Integer
Public Overridable Property MyObject As MyObject
End Class
|
|
|
|
|
OK, in your first code snippet, you do NOT new up a List object. You use the existing HashSet object you created in your MyObject class:
Using context As New MyObjectContext
Dim obj1 As New MyObject
obj1.nm = "123"
obj1.value = 25
Dim child1 As New ChildObject
child1.name = "abc"
child1.vl = "efd"
obj1.ChildObjects.Add(child1)
context.MyObjects.Add(obj1)
context.SaveChanges()
End Using
You also do not need the Public Property MyObjectId As Integer line in the ChildObject class definition. EF will create this field automatically:
Public Class ChildObject
Public Property id As Integer
Public Property name As String
Public Property vl As String
Public Property MyObjectId As Integer <-- remove this line
Public Overridable Property MyObject As MyObject
|
|
|
|
|
Sorry , but if a remove the line MyObjectID , how can I create the relationship between 2 tables in sql server ?
|
|
|
|
|
I already told you, EF takes care of that for you.
|
|
|
|
|
Sorry , because i'm using Database-First and I create the edmx file with wizard from an existing database. I'v tried to do what you are saying , and after I have created the model , these 2 tables are not related and ChildObjects Property does not even exist on MyObject.
|
|
|
|
|
I though you were using Code First. In your case, you have to leave the field in.
In Code First, you don't have to put that field in your model because EF will create and use the field automatically.
|
|
|
|
|
Do While sFolderName <> ""
For i = 0 To dirList.ListCount - 1
w = 1
hIcon = ExtractAssociatedIcon(App.hInstance, "C:\Windows", 3)
If sFolderName <> "" And sFolderName <> "" Then
If (GetAttr(sPath & sFolderName) And vbDirectory) = vbDirectory Then
ListView2.ListItems.add , , sFolderName, Picture2.Picture
Picture2.AutoRedraw = True
Picture2.Cls
DrawIcon Me.Picture2, 0, 0, hIcon
End If
If IsNull(hIcon) Then
picBuff.Picture = Picture2.Picture
Else
End If
sFolderName = Dir
End If
Next
ListView2.Icons = imgFiles
ListView2.SmallIcons = imgFiles
Loop
|
|
|
|
|
Hello all,
This might be a slightly basic question, but I'm trying to get into the head of a previous developer and where they were going with some unfinished code. I apologize if this is vague, but it's all I've got to work with.
Here is what I'm looking at, I've got a User Interface element that implements an interface. I'm confused as to why one would implement a Sub from an interface within a Sub in the UserInterfaceElement like this.
Any ideas?
Public Class UserInterfaceElementClass
Implements IEditableElement
Protected Sub SetupElement() Implements IEditableElement.SetupElement()
End Sub
Protected Sub UpdateObjectFromElement() Implements IEditableElement.UpdateObjectFromElement()
End Sub
End Class
Public Interface IEditableElement
Sub SetupElement()
End Sub
Sub UpdateObjectFromElement()
End Sub
End Interface
|
|
|
|
|
hilli_micha wrote: I'm confused as to why one would implement a Sub from an interface within a Sub in the UserInterfaceElement like this.
Because that's how interfaces work. I'm confused by your confusion.
An interface doesn't provide any implementation. It simply declares a contract for a type.
A class which implements the interface must provide an implementation of every member of that interface. In VB.NET, the implementation of the interface member is indicated by the Implements InterfaceName.MemberName after the member declaration.
Any class which implements an interface can be passed to any parameter, property, variable or method return declared as that interface type.
Interfaces (Visual Basic)[^]
Walkthrough: Creating and Implementing Interfaces (Visual Basic)[^]
Advantage of using Interface and Inheritance in VB.NET (OOP)[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|