|
How to change the datagrid headers at runtime?i.e to make the font bold of the headers , and also increase the size of font at runtime
HI
|
|
|
|
|
datagrid1.Columns(0).HeaderText = "your text" ' change text to one column
datagrid1.Columns(0).Width = Size ' change size to one column
datagrid1.ColumnHeadersDefaultCellStyle.Font.Bold = True ' change bold to each columns, sorry but i don't know change the bold to one column
|
|
|
|
|
Hello,
I have a maskedTextBox and have set a custom format for inputting an IP Address.
Custom format ###.###.###.###
And have used the string replace(" ","") to remove any white spaces.
However, the dots do not come out after the user has entered the IP address
for example 12.123.566.54
Will come out like: 1212356654.
Does anyone know a better way to do this.
Many thanks for any suggestions,
Steve
|
|
|
|
|
Hi again Steve,
I am not sure, but I think the mask doesn't actually do anything with the input, it just shows the user an example.
One possibility to solve your problem (which I recommend) is to use four textboxes instead of one. Set their respective maximum lengths to 3, and use the following function to control input:
<br />
Public Function TrapKey(ByVal KCode As String) As Boolean<br />
Try<br />
If KCode < 48 Or KCode > 57 Then TrapKey = True<br />
'Add these if you want to allow commas, dots and such: And KCode <> 46 And KCode <> 8 And KCode <> 44<br />
Catch Ex As Exception<br />
Msgbox(Ex.message)<br />
End Try<br />
End Function<br />
Use TrapKey with the KeyPress event of a textbox:
Private Sub MyTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyTextBox.KeyPress<br />
e.Handled = TrapKey(Asc(e.KeyChar))<br />
End Sub
With this approach you allow the user to press tab to jump to the next number, and you can play around with the look of the textboxes, if you want it to look like a single field (no borders, etc).
it may not be the most elegant approach, but remember the difference between the American and Russian space programs?
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hello,
Doesn't sound like a bad idea. Being able to tab to the following text. I might make a user control based on this, as i can see myself using this again.
I am surprized the maskedTextBox doesn't already allow for this.
Thanks for your help,
Steve
|
|
|
|
|
hi
i get trouble with my project in programming...just a lil click in a mouse then i'm done with it...
the problem i couln't search the next record even though it was successfully added in my database but it won't show also in the table.just only one record will show in the table and the rest are not found.
my codes:
Private Sub cmdSearch_Click()
Dim db As Database
Dim rs As Recordset
and so on...
i need help from you...very urgent!
if you'll send me an alternative codes for search it is my pleasure...
thanks...
-- modified at 2:50 Friday 9th March, 2007
-- modified at 2:57 Friday 9th March, 2007
i'm lost;need help in programming!!! :p
-- modified at 3:00 Friday 9th March, 2007
|
|
|
|
|
Your question makes no sense and the code you provided makes less sense.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
Like the other poster said, this makes no sense what-so-ever. The code sample you provided is utterly useless in describing your problem.
You said that you added a record to the database, but the grid your showing these records in doesn't show the new record?? Did you refresh the data source you bound your DataGrid to? If not, then it's not going to know that the database changed and, hence, can't show hat it doesn't know about.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
i need a code snippet to search files from a database namely mysql.
i need to search and concentrate the searched files for further use.
if any body has any idea of this than please help me out.
|
|
|
|
|
|
Hi used javascript and displayed menubars in my form..,
See each menu have submenus...,
i given for each form pageno(its the flag)...,
my ques is very critical,
take eg like..
two menus are there...,
in that two menus have 3,3 submenus..,
now one user can access in that first menu 2 forms and second menu 1 form....,
another can access in first menu 3 forms and second menu 2 forms...,
now how u can tell...,in that login page these are the forms menus only,want to display for that particular user like......,
Plz hlp me....,
regards,
Magesh
|
|
|
|
|
Sounds like a web dev question to me.
Why don't you just use one of the javascript menus that are freely available on the web ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ya i used javascript menus only...,
But i want to dispaly that menus based on the user,
see in my pre msg i mentioned, my probs clearly.....,
like that user rights based menus i didnt get in net,
if u know plz send me that link or code.....,
Magi
|
|
|
|
|
Yeah, this is still a Web Development forum question. It has nothing to to with VB.NET, so I suggest posting this in the correct forum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi i want to use a editor asif richtextbox in my vb.net application could any one help me
i have to highlight the text wat i want to find
i have to change the colors of some key words automatically like any programming language editors do
pls do early help my project is hanging
with regards
Balagurunathan.B
|
|
|
|
|
I have a SSTab component on my form. I want to change the color of it to white with black font on it.
If I change the 'BackColor' to 'White', the back screen changes but not the color of the tabs.
Can anyone please tell me how do I change the color of the tabs on the SSTab component?
|
|
|
|
|
Hi,
You can try:
tabcontrol.TabPages(0).BackColor = somecolor
My advice is free, and you may get what you paid for.
|
|
|
|
|
hi guys i need help again =)
i am currently trying to make a form in a form
i a sure u guys seem microsoft access subform where by the subform is actually another form in the access and the user can navigate the form by those scroll bar even if the window of the form is small
i am trying to do that in vb.net! issit possible? if it is could anyone tell me which control/component to use and how to use it thx
well i mean like i make 2 form ( from1 and form2)
how ever i would like to make a form viewer within form1 to view from 2
meaning: i would be able to view form2 thru a box(form viewer) while being in form1
wat i wanna know is that possible and if it is how? as i dont know if vb.net have such thing as form viewer >.< pls help!
ps:this is a repost as i post in the wrong topic >.<
|
|
|
|
|
What you are asking for is called MDI. So, now you can search for it.
---
single minded; short sighted; long gone;
|
|
|
|
|
as u might be knowing now that this is MDI(Multipple document interface).
u can make this in the way given below..
first of all make a parent form by selecting iscontainer property as true..
nw add tree view or pic box, whichever you want...
make a click event in parent form and add a new form2.
and under the click event write this coding...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim NewMDIChild As New Form2()
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Me
'Display the new form.
NewMDIChild.Show()
end sub()
and change the window sate of both form1 and form 2 as maximum if u want..
thats it..
form2 is MDI child now,
if u have any doubt regarding MDI post yr problem..
bye
bye...
|
|
|
|
|
Perhaps you should answer the original poster instead of me.
Tip: It would be easier to read what you write if you stick to the standard style of writing instead of inventing your own. The start of a sentence is signified by making the first letter in the word capital, not by putting it on a new line. A sentence is ended by a singe period, not two or three.
---
single minded; short sighted; long gone;
|
|
|
|
|
There's another way to do this without using MDI. You can find an example in this[^] MSDN article, or if MSDN is responding, like it is now, you can search for it later by Googling for "Five Tricks for your Visual Basic .NET bag".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have hierarchical data that the user can make one of four choices about. The primary treeview manages @900 rows of data that collapsed to @100 groups.
I need to draw a tree view with a 'radio button group' where the radio buttons are related to the treeview node index.
I have made a User Control for the 4 radio button but can't quite figure out:
1) How to Position the radiobuttonControl to align with the tree view node
2) Linkage to connect the option group data to the index appropriate treeview node
i.e.
[a,b,c,d] tvNode1
[a,b,c,d] tvNode2
Each control is located on separate panels, panel 1 is for the radio buttons, panel 2 is for the Treeview. - Is there may be a better way???
TIA
Tom Hamilton
Sacramento, CA
|
|
|
|
|
I am trying to create a program that allows users to create new folders and set security permissions. Any help would be greatly appreciated. VBV.NET/ NET Framework 2.0
|
|
|
|
|
If you Import System.IO
You will have access to the Directory object.
You can do a Directory.CreateDirectory(path, directorySecurity)
where path is your new folder
and directorySecurity is the directory security for the folder.
Here some sample code from Microsoft help on directorysecurity:
Imports System
Imports System.IO
Imports System.Security.AccessControl
Module DirectoryExample
Sub Main()
Try
Dim DirectoryName As String = "TestDirectory"
Console.WriteLine("Adding access control entry for " + DirectoryName)
' Add the access control entry to the directory.
AddDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)
Console.WriteLine("Removing access control entry from " + DirectoryName)
' Remove the access control entry from the directory.
RemoveDirectorySecurity(DirectoryName, "MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow)
Console.WriteLine("Done.")
Catch e As Exception
Console.WriteLine(e)
End Try
Console.ReadLine()
End Sub
' Adds an ACL entry on the specified directory for the specified account.
Sub AddDirectorySecurity(ByVal FileName As String, ByVal Account As String, ByVal Rights As FileSystemRights, ByVal ControlType As AccessControlType)
' Create a new DirectoryInfoobject.
Dim dInfo As New DirectoryInfo(FileName)
' Get a DirectorySecurity object that represents the
' current security settings.
Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
' Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(New FileSystemAccessRule(Account, Rights, ControlType))
' Set the new access settings.
dInfo.SetAccessControl(dSecurity)
Hope that helps.
Ben
|
|
|
|