没有填满网格

时间:2016-08-25 03:59:37

标签: vb.net mdiparent

美好的一天,

我在MDI表单中遇到问题,有主表单,并有2个按钮,这些按钮导致子表单,其中一个表单允许您从数据库中选择一个类别,并在其中填充网格,一切正常,直到我使用事件如下的按钮将表单嵌入MDI:

Private Sub ButtonCatego_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonCatego.ItemClick
    Dim addCategory As New AddCategory
    addCategory.MdiParent = Me.MdiParent
    addCategory.Show()
End Sub

当我使用普通事件时:

Private Sub ButtonCatego_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles ButtonCatego.ItemClick
    AddCategory.Show()
End Sub

请帮帮我。谢谢

1 个答案:

答案 0 :(得分:0)

您正在将<!doctype html> <html> <head> <title>student</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div id="wrapper"><!--start wrapper--> <div id="navbar"><!--start nav--> <ul> <li><a href="home.html">Home</li> <li><a href="about.html">About us</li> <li><a href="services.html">Services</li> <li><a href="products.html">Products</li> <li><a href="contact.html">Contact us</li> </ul> </div><!--end nav--> <div id="myCarousel" class="carousel slide" data-ride="carousel"><!--carasel start--> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> <li data-target="#myCarousel" data-slide-to="3"></li> <li data-target="#myCarousel" data-slide-to="4"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="D:\task\photo\h.jpg" alt="Home" height="400px"> <div class="carousel-caption"> <h3>Home</h3> </div> </div> <div class="item"> <img src="D:\task\photo\as.jpg" alt="About us" height="400px"> <div class="carousel-caption"> <h3>About us</h3> </div> </div> <div class="item"> <img src="D:\task\photo\s.jpg" alt="Services" height="400px"> <div class="carousel-caption"> <h3>Services</h3> </div> </div> <div class="item"> <img src="D:\task\photo\p.jpg" alt="Products" height="400px"> <div class="carousel-caption"> <h3>products</h3> </div> </div> <div class="item"> <img src="D:\task\photo\c.jpg" alt="Contact us" height="400px"> <div class="carousel-caption"> <h3>Contact us</h3> </div> </div> </div> <!-- Left and right controls --> <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div><!--end carosel--> <div class="container-fluid text-center bg-grey"><!--boxes--> <div class="row text-center"> <div class="col-sm-4"> <div class="thumbnail"> <img src="D:\task\photo\i.jpg" alt="Innovation"> <p><strong>Innovation</strong></p> </div> </div> <div class="col-sm-4"> <div class="thumbnail"> <img src="D:\task\photo\cr.png" alt="Creative"> <p><strong>Creativity</strong></p> </div> </div> <div class="col-sm-4"> <div class="thumbnail"> <img src="D:\task\photo\po.jpg" alt="Positive"> <p><strong>Positivity</strong></p> </div> </div> </div><!--end boxes--> <div id="con"> <div class="contact"> <h1>Address</h1> <p><span class="glyphicon glyphicon-map-marker"></span> Abc private limited no54,2ndstreet, madipakkam, chennai-67. </p> <p><span class="glyphicon glyphicon-envelope"></span> ABCPVT@gmail.com</p> </div> <div class="enquiry"> <h1>Enquiry Form</h1> <table border="0" align="center"> <form name="form" action="email.php" id="form" method="post"> <tr> <tr> <td>Name</td> <td><input name="name" placeholder="Name" type="text" value=""></td> </tr> <tr> <td>Email</td> <td><input name="email" placeholder="Email" type="text" value=""></td> </tr> <tr> <td>Phone</td> <td><input name="phone" placeholder="phonenumber" type="text" value=""></td> </tr> <tr> <td>Message</td> <td><textarea name="msg" placeholder="Type your text here..."></textarea></td> </tr> <td colspan="2" style="text-align:center"><input id="send" name="submit" type="submit" value="Submit"></td> </tr> </form> </table> </div> </div> <div class="footer"> copyrights &copy; to WWW.abcpvt.com <img src="E:\photos\fb.png" alt="fb"/> <img src="E:\photos\ln.png" alt="tweet"/> <img src="E:\photos\tw.png" alt="linkedin"/> </div> </div><!--end wrapper--> </body> </html>设置为当前表单的MDI父级。如果addCategory.MdiParent是您的主要表单,那么它就不会拥有MDI父级,这就是您无法使用它的原因。

Me设置为addCategory.MdiParent,它应解决您的问题:

Me